summaryrefslogtreecommitdiff
path: root/etckeeper
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2009-02-14 01:15:47 -0500
committerJoey Hess <joey@gnu.kitenet.net>2009-02-14 01:15:51 -0500
commit607f12f1ada14b4a6d69d745d5a4a7b3db3ecb36 (patch)
tree96d1a6a78c708d94b637913eff898ab27ab476b9 /etckeeper
parentec0218e86b32dd80d8cb4e5a69ea7d7c9b5f4ad6 (diff)
Fix handling of -d in recursive calls to etckeeper
Some etckeeper scripts run 'etckeeper unclean' and other subcommands. If -d was specified, those subcommands would run on /etc, rather than the -d directory. Use an env var to propigate the directory to the subcommands.
Diffstat (limited to 'etckeeper')
-rwxr-xr-xetckeeper10
1 files changed, 7 insertions, 3 deletions
diff --git a/etckeeper b/etckeeper
index 66b9e08..7a6933c 100755
--- a/etckeeper
+++ b/etckeeper
@@ -60,15 +60,19 @@ fi
if [ "x$1" = "x-d" ]; then
if [ -n "$2" ]; then
- cd "$2"
+ ETCKEEPER_DIR="$2"
shift 2
else
usage
fi
-else
- cd /etc
fi
+if [ -z "$ETCKEEPER_DIR" ]; then
+ ETCKEEPER_DIR=/etc
+fi
+cd "$ETCKEEPER_DIR"
+export ETCKEEPER_DIR
+
lsscripts() {
perl -e '
$dir=shift;