home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / var / lib / dpkg / info / doc-base.prerm < prev    next >
Encoding:
Text File  |  2007-02-22  |  1.1 KB  |  54 lines

  1. #!/bin/sh
  2. # prerm for doc-base
  3.  
  4. # Abort if any command returns an error value
  5. set -e
  6.  
  7. package=doc-base
  8.  
  9. if [ "$DEBUG" ]; then
  10.     echo entering $package prerm
  11.     set -x
  12. fi
  13.  
  14. remove_docs ( ) {
  15.   if which install-docs >/dev/null 2>&1; then
  16.     install-docs -r $package || true
  17.     install-docs -r install-docs-man || true
  18.   else
  19.     echo "cannot find install-docs on path" 1>&2
  20.   fi
  21. }
  22.  
  23. remove_all_docs ( ) {
  24.     if which install-docs >/dev/null 2>&1; then
  25.         echo "unregistering documentation ..."
  26.         for file in /var/lib/doc-base/info/*.status; do
  27.             install-docs -r `basename $file .status` || true
  28.         done
  29.     else
  30.     # error because we this *is* the doc-base package
  31.     echo "cannot find install-docs on path" 1>&2
  32.     exit 1
  33.     fi
  34. }
  35.  
  36.  
  37. case "$1" in
  38.   remove)
  39.     remove_all_docs
  40.     ;;
  41.   upgrade)
  42.     remove_docs
  43.     ;;
  44.   failed-upgrade)
  45.     # Prepare to upgrade from version $2 of this package TO THIS VERSION.
  46.     # This is only used if the old version's prerm couldn't handle it,
  47.     # and returned non-zero.  (Fix old prerm bugs here.)
  48.     ;;
  49. esac
  50.  
  51.  
  52.  
  53. exit 0
  54.