#! /bin/sh # postrm script for sbuild # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `remove' # * `purge' # * `upgrade' # * `failed-upgrade' # * `abort-install' # * `abort-install' # * `abort-upgrade' # * `disappear' overwrit>r> # for details, see /usr/share/doc/packaging-manual/ PACKAGE="schroot" # Remove a conffile which has been forgotten by dpkg # If the file does not exist, or is owned by any package, do not remove it. rm_conffile() { CONFFILE="$1" local delete; delete="false" if [ -f "$CONFFILE" ]; then local fpkg; fpkg="" local pkg; pkg="" if fpkg=$(dpkg -S "$CONFFILE" 2>/dev/null); then # Don't delete, but check which package it came from. pkg=$(echo $fpkg | sed -e 's/\(^[[:print:]][[:print:]]*\): .*$/\1/') if [ "$pkg" = "$PACKAGE" ]; then delete="true" fi else rm -f "$CONFFILE" delete="true" fi else delete="true" fi # Remove dpkg cruft if [ "$delete" = "true" ]; then rm -f "${CONFFILE}.dpkg-old" rm -f "${CONFFILE}.dpkg-new" rm -f "${CONFFILE}.dpkg-dist" fi } case "$1" in upgrade|failed-upgrade|abort-install|abort-upgrade) ;; remove) ;; purge|disappear) ;; *) echo "postrm 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