diff options
author | Joey Hess <joey@kodama.kitenet.net> | 2008-03-20 22:47:24 -0400 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2008-03-20 22:47:24 -0400 |
commit | 34172d87ef01b4c015f66b06d5088ae7d1d2d0b9 (patch) | |
tree | 4397b040cd1aa4baca2d83eb54a0b9dd6d4bf0f4 /debian | |
parent | 2f07cc06c5abba1a3f43f28b9fb87d36515196e5 (diff) |
transition code
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 |