#!/bin/sh -e

set -e

# summary of how this script can be called:
#        * <prerm> `remove'
#        * <old-prerm> `upgrade' <new-version>
#        * <new-prerm> `failed-upgrade' <old-version>
#        * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
#        * <deconfigured's-prerm> `deconfigure' `in-favour'
#          <package-being-installed> <version> `removing'
#          <conflicting-package> <version>
# for details, see /usr/share/doc/packaging-manual/


case "$1" in
    purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
        echo "Repairing xscreensaver-getimage-file..."
	/etc/init.d/kiosek stop >/dev/null 2>&1
        dpkg-divert --remove --rename /usr/bin/xscreensaver-getimage-file
    ;;
    
    *)
	echo "prerm called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

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

exit 0
