preinst is in base-files 7.2ubuntu5.
This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.
The actual contents of the file can be viewed below.
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 | #!/bin/sh
set -e
rm_if_matches_md5sum() {
F="$1"
M="$2"
if [ -e "$F" ]; then
md5=$(md5sum "$F" | cut -f 1 -d\ )
if [ "$md5" = "$M" ]; then
rm "$F"
fi
fi
}
case "$1" in
install|upgrade)
# older versions did not ship /etc/os-release as a conffile but
# newer do, because the content changed this triggers a conffile prompt
# now. by removing the file (if unmodified) we avoid this prompt and
# dpkg will re-create it
if dpkg --compare-versions "$2" le-nl "6.5ubuntu11"; then
rm_if_matches_md5sum "/etc/os-release" f8186963c93529f30f62095d35d44138
rm_if_matches_md5sum "/etc/os-release" f528f92199aadbee067e3a24d4b1077a
rm_if_matches_md5sum "/etc/os-release" 0cacc849efc99ac03921a892ca9e0db1
fi
;;
esac
dpkg-maintscript-helper rm_conffile /etc/update-motd.d/99-footer 7.2ubuntu2~ -- "$@"
|