From 27eda35e0b9758e1611ca7c4c0eb625f2246dd68 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 5 Nov 2007 17:09:08 -0500 Subject: rationalise the cd /etc handling --- etckeeper | 4 ++++ init.d/50git-add | 1 - post-apt.d/50git-add | 1 - pre-apt.d/50uncommitted-changes | 1 - 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 -- cgit v1.2.3