Permalink
Browse files

Change etckeeper uninit to not remove .gitignore (etc) file if it lac…

…ks the "managed by etckeeper" comment. Closes: #545137
  • Loading branch information...
1 parent e382059 commit dd45df9d9209f2f47042e76c32476a21884b7c52 Joey Hess committed Sep 7, 2009
Showing with 23 additions and 4 deletions.
  1. +7 −0 debian/changelog
  2. +16 −4 uninit.d/50vcs-uninit
View
@@ -1,3 +1,10 @@
+etckeeper (0.41) UNRELEASED; urgency=low
+
+ * Change etckeeper uninit to not remove .gitignore (etc) file
+ if it lacks the "managed by etckeeper" comment. Closes: #545137
+
+ -- Joey Hess <joeyh@debian.org> Mon, 07 Sep 2009 14:06:45 -0400
+
etckeeper (0.40) unstable; urgency=low
* Add Spanish debconf translation. Closes: #539589
View
@@ -2,11 +2,23 @@
set -e
if [ "$VCS" = git ]; then
- rm -rf .git .gitignore
+ rm -rf .git
+ file=.gitignore
elif [ "$VCS" = hg ]; then
- rm -rf .hg .hgignore
+ rm -rf .hg
+ file=.hgignore
elif [ "$VCS" = bzr ]; then
- rm -rf .bzr .bzrignore
+ rm -rf .bzr
+ file=.bzrignore
elif [ "$VCS" = darcs ]; then
- rm -rf _darcs .darcsignore
+ rm -rf _darcs
+ file=.darcsignore
+fi
+
+managed_by_etckeeper="managed by etckeeper"
+
+if ! grep -q "$managed_by_etckeeper" "$file"; then
+ echo "etckeeper: "$file" does not contain \"$managed_by_etckeeper\" comment; not removing"
+else
+ rm -f $file
fi

0 comments on commit dd45df9

Please sign in to comment.