diff options
author | Joey Hess <joey@gnu.kitenet.net> | 2009-02-14 01:15:47 -0500 |
---|---|---|
committer | Joey Hess <joey@gnu.kitenet.net> | 2009-02-14 01:15:51 -0500 |
commit | 607f12f1ada14b4a6d69d745d5a4a7b3db3ecb36 (patch) | |
tree | 96d1a6a78c708d94b637913eff898ab27ab476b9 /etckeeper | |
parent | ec0218e86b32dd80d8cb4e5a69ea7d7c9b5f4ad6 (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-x | etckeeper | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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; |