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.postinst < prev    next >
Encoding:
Text File  |  2007-02-22  |  1.5 KB  |  54 lines

  1. #!/bin/sh
  2. # postinst for doc-base
  3.  
  4. # Abort if any command returns an error value
  5. set -e
  6.  
  7. package=doc-base
  8. # upgrades prior to this version require complete re-registration
  9. compat_ver=0.7.21
  10. # upgrades of the following version requires complete re-registration
  11. bad_ver=0.7.13
  12. VERBOSE=
  13.  
  14. if [ "$DEBUG" ]; then
  15.     echo entering $package postinst
  16.     set -x
  17. fi
  18.  
  19. reinstall_docs ( ) {
  20.     # install all the existing doc-base control files
  21.     num=`find /usr/share/$package/ -maxdepth 1 -type f | wc -l`
  22.     echo "(re)registering $num documents from /usr/share/$package ..." >&2
  23.     for file in /usr/share/$package/*; do
  24.         [ -f $file ] && install-docs ${VERBOSE} --no-update-menus -i $file || true  # don't abort on failure
  25.     done
  26.     if [ -x /usr/bin/update-menus ]; then
  27.         /usr/bin/update-menus
  28.     fi
  29. }
  30.  
  31. case "$1" in
  32.   configure)
  33.     if [ "${2+set}" != set ] || [ -z "$2" ] || [ "$2" = "<unknown>" ]; then
  34.         # first install, or upgrade from ancient version
  35.         reinstall_docs
  36.     elif dpkg --compare-versions $2 lt $compat_ver; then
  37.     # version is less than last compatable version, we need to
  38.     # re-register all the docs
  39.         reinstall_docs
  40.     elif dpkg --compare-versions $2 eq $bad_ver; then
  41.         # bad version, ew, re-register
  42.         reinstall_docs
  43.     else
  44.         # only register our stuff
  45.         install-docs ${VERBOSE} --no-update-menus -i /usr/share/$package/$package
  46.         install-docs ${VERBOSE} -i /usr/share/$package/install-docs-man
  47.     fi
  48.     ;;
  49. esac
  50.  
  51.  
  52.  
  53. exit 0
  54.