diff options
Diffstat (limited to 'debian/preinst')
-rw-r--r-- | debian/preinst | 42 |
1 files changed, 25 insertions, 17 deletions
diff --git a/debian/preinst b/debian/preinst index 3b927e4..80ed595 100644 --- a/debian/preinst +++ b/debian/preinst @@ -18,23 +18,23 @@ prep_mv_conffile() { } # Remove a no-longer used conffile -#rm_conffile() { -# PKGNAME="$1" -# CONFFILE="$2" -# -# if [ -e "$CONFFILE" ]; then -# md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`" -# old_md5sum="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\' $CONFFILE'{s/ obsolete$//;s/.* //p}\"`" -# if [ "$md5sum" != "$old_md5sum" ]; then -# echo "Obsolete conffile $CONFFILE has been modified by you." -# echo "Saving as $CONFFILE.dpkg-bak ..." -# mv -f "$CONFFILE" "$CONFFILE".dpkg-bak -# else -# echo "Removing obsolete conffile $CONFFILE ..." -# rm -f "$CONFFILE" -# fi -# fi -#} +rm_conffile() { + PKGNAME="$1" + CONFFILE="$2" + + if [ -e "$CONFFILE" ]; then + md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`" + old_md5sum="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\' $CONFFILE'{s/ obsolete$//;s/.* //p}\"`" + if [ "$md5sum" != "$old_md5sum" ]; then + echo "Obsolete conffile $CONFFILE has been modified by you." + echo "Saving as $CONFFILE.dpkg-bak ..." + mv -f "$CONFFILE" "$CONFFILE".dpkg-bak + else + echo "Removing obsolete conffile $CONFFILE ..." + rm -f "$CONFFILE" + fi + fi +} case "$1" in install|upgrade) @@ -56,4 +56,12 @@ install|upgrade) done fi + if dpkg --compare-versions "$2" le "0.13"; then + for c in 20store-empty-directory 40rm-old-metadata; do + rm_conffile etckeeper "/etc/etckeeper/pre-commit.d/$c" + done + for c in 10restore-etckeeper 20restore-metadata; do + prep_mv_conffile etckeeper "/etc/etckeeper/init.d/$c" + done + fi esac |