1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
#!/bin/sh
set -e
purge_debuginfod_debian()
{
for ext in sh csh; do
[ -f /etc/profile.d/debuginfod."${ext}" ] || continue
if command -v ucf > /dev/null; then
ucf --purge /etc/profile.d/debuginfod."${ext}"
fi
if command -v ucfr > /dev/null; then
ucfr --purge libdebuginfod-common /etc/profile.d/debuginfod."${ext}"
fi
rm -f /etc/profile.d/debuginfod."${ext}"
done
}
purge_debuginfod_ubuntu()
{
CONFTEMPLATEPATH="/usr/share/libdebuginfod-common"
for ext in sh csh; do
[ -L "/etc/profile.d/debuginfod.${ext}" ] || continue
# Only remove the file if it's a symlink to the file we
# installed under ${CONFTEMPLATEPATH}.
if [ "$(readlink -m /etc/profile.d/debuginfod.${ext})" \
= "${CONFTEMPLATEPATH}/debuginfod.${ext}" ]; then
rm -f "/etc/profile.d/debuginfod.${ext}"
fi
done
}
case "$1" in
purge)
if grep -qFx "ID=debian" /etc/os-release; then
purge_debuginfod_debian
elif grep -qFx "ID=ubuntu" /etc/os-release; then
purge_debuginfod_ubuntu
fi
;;
remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
;;
*)
echo "postrm called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0
|