diff options
Diffstat (limited to 'debian')
-rw-r--r-- | debian/changelog | 11 | ||||
-rw-r--r-- | debian/postinst | 6 | ||||
-rw-r--r-- | debian/preinst | 42 |
3 files changed, 42 insertions, 17 deletions
diff --git a/debian/changelog b/debian/changelog index 568ffe1..286ab28 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,17 @@ etckeeper (0.13) UNRELEASED; urgency=low * Drop the debconf prompt before committing in pre-install. Closes: #470577, #462161 + * Stop using metastore, instead add shell commands to .etckeeper + to handle permissions. Patch by Scott Bronson. The main advantages + of this approach are: + - .etckeeper uses less disk space than .metadata. + - Git diff includes changes to the commands in the file, which is more + transparent than a change to the binary .metadata file, and does not + produce conflicts during merging. + Note that repositories still including .metadata files will be + automatically transitioned, and the file removed, and etckeeper init + on out a historical version of a repository that still contains .metadata + will use it, if metastore is installed. -- Joey Hess <joeyh@debian.org> Fri, 14 Mar 2008 01:51:53 -0400 diff --git a/debian/postinst b/debian/postinst index 7cd4573..e4fb0b3 100644 --- a/debian/postinst +++ b/debian/postinst @@ -59,4 +59,10 @@ configure) done fi + if dpkg --compare-versions "$2" le "0.13"; then + mv_conffile "/etc/etckeeper/init.d/10restore-etckeeper" \ + "/etc/etckeeper/init.d/20restore-etckeeper" + mv_conffile "/etc/etckeeper/init.d/20restore-metadata" \ + "/etc/etckeeper/init.d/10restore-metadata" + fi esac 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 |