#!/bin/sh -e

# summary of how this script can be called:
#        * <postinst> `configure' <most-recently-configured-version>
#        * <old-postinst> `abort-upgrade' <new version>
#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
#          <new-version>
#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
#          <failed-install-package> <version> `removing'
#          <conflicting-package> <version>

case "$1" in
    configure)

	. /usr/share/debconf/confmodule

	db_version 2.0

	db_get openafs-fileserver/thiscell
	echo $RET >/etc/openafs/server/ThisCell
	if [ -f /etc/openafs/server/CellServDB ] ; then :
	    else echo \>$RET >/etc/openafs/server/CellServDB
	    fi
	    if [ "x$2" != "x" ] ; then
		if dpkg --compare-versions $2 lt 1.2.0-1 ; then
		    mv /etc/openafs/server-local/BosConfig /etc/openafs/BosConfig ||true
		    mv /etc/openafs/server-local/sysid /var/lib/openafs ||true
		    fi
		fi
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)

    ;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 0
    ;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#

exit 0
