Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Do not warn about special files or hardlinks if they are ignored by g…

…it. Fixes #549354 for git, but not for other VCSs.
  • Loading branch information...
commit 739337c857303388ac11d66d15323286393dd981 1 parent 29a3d7f
@joeyh joeyh authored
View
2  debian/changelog
@@ -2,6 +2,8 @@ etckeeper (0.50) UNRELEASED; urgency=low
* Add Danish translation of debconf templates. Closes: #597768
* Ignore /etc/.initctl. Closes: #598121
+ * Do not warn about special files or hardlinks if they are ignored by
+ git. Fixes #549354 for git, but not for other VCSs.
-- Joey Hess <joeyh@debian.org> Wed, 22 Sep 2010 17:45:57 -0400
View
5 debian/preinst
@@ -69,6 +69,11 @@ install|upgrade)
rm_conffile etckeeper "/etc/etckeeper/commit.d/$c"
done
fi
+ if dpkg --compare-versions "$2" le "0.50"; then
+ for c in 20warn-hardlinks 20warn-special-file; do
+ rm_conffile etckeeper "/etc/etckeeper/pre-commit.d/$c"
+ done
+ fi
# delete files the prerm stashes away to handle purging
rm -rf /var/cache/etckeeper/stash
View
2  etckeeper.spec
@@ -1,5 +1,5 @@
Name: etckeeper
-Version: 0.49
+Version: 0.50
Release: 4%{?dist}
Summary: store /etc in git, mercurial, bzr or darcs
View
10 pre-commit.d/20warn-hardlinks
@@ -1,10 +0,0 @@
-#!/bin/sh
-set -e
-
-if [ "$VCS" = git ] || [ "$VCS" = hg ] || [ "$VCS" = bzr ] || [ "$VCS" = darcs ]; then
- hardlinks=$(find . -type f -not -links 1 | grep -v '/\(.git\|.hg\|.bzr\|_darcs\)/' ) || true
- if [ -n "$hardlinks" ]; then
- echo "etckeeper warning: hardlinked files could cause problems with $VCS:" >&2
- echo "$hardlinks" >&2
- fi
-fi
View
27 pre-commit.d/20warn-problem-files
@@ -0,0 +1,27 @@
+#!/bin/sh
+set -e
+
+exclude_internal () {
+ grep -v '/\(.git\|.hg\|.bzr\|_darcs\)/'
+}
+
+if [ "$VCS" = hg ] || [ "$VCS" = bzr ] || [ "$VCS" = darcs ]; then
+ special=$(find . -not -type d -not -type f -not -type l | exclude_internal) || true
+ hardlinks=$(find . -type f -not -links 1 | exclude_internal ) || true
+elif [ "$VCS" = git ]; then
+ special=$(find . -not -type d -not -type f -not -type l -exec git ls-files --exclude-standard --cached --others {} \; | exclude_internal) || true
+ hardlinks=$(find . -type f -not -links 1 -exec git ls-files --exclude-standard --cached --others {} \; | exclude_internal) || true
+else
+ special=""
+fi
+
+if [ -n "$special" ]; then
+ echo "etckeeper warning: special files could cause problems with $VCS:" >&2
+ echo "$special" >&2
+fi
+if [ -n "$hardlinks" ]; then
+ echo "etckeeper warning: hardlinked files could cause problems with $VCS:" >&2
+ echo "$hardlinks" >&2
+fi
+
+true
View
12 pre-commit.d/20warn-special-file
@@ -1,12 +0,0 @@
-#!/bin/sh
-set -e
-
-if [ "$VCS" = git ] || [ "$VCS" = hg ] || [ "$VCS" = bzr ] || [ "$VCS" = darcs ]; then
- special=$(find . -not -type d -not -type f -not -type l | grep -v '/\(.git\|.hg\|.bzr\|_darcs\)/') || true
- if [ -n "$special" ]; then
- echo "etckeeper warning: special files could cause problems with $VCS:" >&2
- echo "$special" >&2
- fi
-fi
-
-true
Please sign in to comment.
Something went wrong with that request. Please try again.