summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xetckeeper4
-rwxr-xr-xinit.d/50git-add1
-rwxr-xr-xpost-apt.d/50git-add1
-rwxr-xr-xpre-apt.d/50uncommitted-changes1
4 files changed, 4 insertions, 3 deletions
diff --git a/etckeeper b/etckeeper
index dd44b02..7ba2682 100755
--- a/etckeeper
+++ b/etckeeper
@@ -17,4 +17,8 @@ if [ ! -d "/etc/etckeeper/$command.d" ]; then
exit 1
fi
+if [ "$command" = post-apt ] || [ "$command" = pre-apt ]; then
+ `cd /etc
+fi
+
run-parts "/etc/etckeeper/$command.d"
diff --git a/init.d/50git-add b/init.d/50git-add
index 903e5aa..06504b4 100755
--- a/init.d/50git-add
+++ b/init.d/50git-add
@@ -1,6 +1,5 @@
#!/bin/sh
set -e
-cd /etc
if ! git-add .; then
echo "etckeeper warning: git-add failed" >&2
fi
diff --git a/post-apt.d/50git-add b/post-apt.d/50git-add
index 903e5aa..06504b4 100755
--- a/post-apt.d/50git-add
+++ b/post-apt.d/50git-add
@@ -1,6 +1,5 @@
#!/bin/sh
set -e
-cd /etc
if ! git-add .; then
echo "etckeeper warning: git-add failed" >&2
fi
diff --git a/pre-apt.d/50uncommitted-changes b/pre-apt.d/50uncommitted-changes
index 4c0c5ee..5a198ef 100755
--- a/pre-apt.d/50uncommitted-changes
+++ b/pre-apt.d/50uncommitted-changes
@@ -1,6 +1,5 @@
#!/bin/sh
set -e
-cd /etc
while git-status || ! LANG=C git-status 2>&1 | grep -q "working directory clean"
do
echo "etckeeper warning: /etc has uncommitted changes" >&2