/usr/share/debhelper/autoscripts/preinst-removeconffile is in debhelper 9.20120115ubuntu3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 | if [ "$1" = install ] || [ "$1" = upgrade ]; then
if [ -e "#OLD#" ] && [ ! -L "#OLD#" ]; then
if [ "`md5sum \"#OLD#\" | sed -e \"s/ .*//\"`" != \
"`dpkg-query -W -f='${Conffiles}' #PACKAGE# | sed -n -e \"\\\\' #OLD# '{s/ obsolete$//;s/.* //p}\"`" ]
then
echo "Obsolete conffile #OLD# has been modified by you, renaming to .dpkg-bak"
mv -f "#OLD#" "#OLD#.dpkg-bak"
else
rm -f "#OLD#"
fi
fi
fi
|