2
# postrm script for buildd
4
# see: dh_installdeb(1)
8
# summary of how this script can be called:
11
# * <old-postrm> `upgrade' <new-version>
12
# * <new-postrm> `failed-upgrade' <old-version>
13
# * <new-postrm> `abort-install'
14
# * <new-postrm> `abort-install' <old-version>
15
# * <new-postrm> `abort-upgrade' <old-version>
16
# * <disappearer's-postrm> `disappear' <r>overwrit>r> <new-version>
17
# for details, see /usr/share/doc/packaging-manual/
21
# Remove a conffile which has been forgotten by dpkg
22
# If the file does not exist, or is owned by any package, do not remove it.
26
local delete; delete="false"
28
if [ -f "$CONFFILE" ]; then
31
if fpkg=$(dpkg -S "$CONFFILE" 2>/dev/null); then
32
# Don't delete, but check which package it came from.
33
pkg=$(echo $fpkg | sed -e 's/\(^[[:print:]][[:print:]]*\): .*$/\1/')
34
if [ "$pkg" = "$PACKAGE" ]; then
46
if [ "$delete" = "true" ]; then
47
rm -f "${CONFFILE}.dpkg-old"
48
rm -f "${CONFFILE}.dpkg-new"
49
rm -f "${CONFFILE}.dpkg-dist"
55
remove|upgrade|failed-upgrade|abort-install|abort-upgrade)
61
if getent group buildd > /dev/null; then
62
deluser --system buildd || true
65
rm_conffile "/etc/buildd.conf"
66
rm_conffile "/etc/buildd.conf.local"
72
echo "postrm called with unknown argument \`$1'" >&2
78
# dh_installdeb will replace this with shell code automatically
79
# generated by other debhelper scripts.