home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
- # postinst for doc-base
-
- # Abort if any command returns an error value
- set -e
-
- package=doc-base
- # upgrades prior to this version require complete re-registration
- compat_ver=0.7.21
- # upgrades of the following version requires complete re-registration
- bad_ver=0.7.13
- VERBOSE=
-
- if [ "$DEBUG" ]; then
- echo entering $package postinst
- set -x
- fi
-
- reinstall_docs ( ) {
- # install all the existing doc-base control files
- num=`find /usr/share/$package/ -maxdepth 1 -type f | wc -l`
- echo "(re)registering $num documents from /usr/share/$package ..." >&2
- for file in /usr/share/$package/*; do
- [ -f $file ] && install-docs ${VERBOSE} --no-update-menus -i $file || true # don't abort on failure
- done
- if [ -x /usr/bin/update-menus ]; then
- /usr/bin/update-menus
- fi
- }
-
- case "$1" in
- configure)
- if [ "${2+set}" != set ] || [ -z "$2" ] || [ "$2" = "<unknown>" ]; then
- # first install, or upgrade from ancient version
- reinstall_docs
- elif dpkg --compare-versions $2 lt $compat_ver; then
- # version is less than last compatable version, we need to
- # re-register all the docs
- reinstall_docs
- elif dpkg --compare-versions $2 eq $bad_ver; then
- # bad version, ew, re-register
- reinstall_docs
- else
- # only register our stuff
- install-docs ${VERBOSE} --no-update-menus -i /usr/share/$package/$package
- install-docs ${VERBOSE} -i /usr/share/$package/install-docs-man
- fi
- ;;
- esac
-
-
-
- exit 0
-