diff options
author | Joey Hess <joey@kodama.kitenet.net> | 2008-01-15 14:21:46 -0500 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2008-01-15 14:21:46 -0500 |
commit | c8f16796c6c72251814626ccf911d8f025cc60f3 (patch) | |
tree | 17c99c0cc0570d2167ceb3cf888d60df304a757a /debian/preinst | |
parent | 45fa1c5a4d911503b545df62c4e276807063dc4e (diff) |
* Convert the directory parameter of etckeeper into "-d directory".
* Pass other patameters on from etckeeper to the .d scripts.
* Stop using run-parts for various reasons.
* Split out a commit.d that contains committing code that's used by
both the pre-install.d and post-install.d scripts.
* Split out an unclean.d that tests if the WC contains uncommitted
changes.
* Add preinst code to remove old post-install.d scripts.
Diffstat (limited to 'debian/preinst')
-rw-r--r-- | debian/preinst | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/debian/preinst b/debian/preinst index c1fdc27..7caa62d 100644 --- a/debian/preinst +++ b/debian/preinst @@ -17,6 +17,25 @@ prep_mv_conffile() { fi } +# 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 +} + case "$1" in install|upgrade) if dpkg --compare-versions "$2" le "0.7"; then @@ -31,4 +50,10 @@ install|upgrade) prep_mv_conffile etckeeper "/etc/etckeeper/init.d/$c" done fi + if dpkg --compare-versions "$2" le "0.10"; then + for c in 10vcs-test 30git-add 30hg-addremove 40git-rm; do + rm_conffile etckeeper "/etc/etckeeper/post-install.d/$c" + + done + fi esac |