--- etckeeper/etckeeper.orig 2015-03-14 18:24:26.000000000 +0100 +++ etckeeper/etckeeper 2015-04-07 00:54:26.014557154 +0200 @@ -1,6 +1,10 @@ #!/bin/sh set -e +if [ -z "$ETCKEEPER_LIB_DIR" ]; then + ETCKEEPER_LIB_DIR=/lib/etckeeper +fi + if [ -z "$ETCKEEPER_CONF_DIR" ]; then ETCKEEPER_CONF_DIR=/etc/etckeeper fi @@ -84,8 +88,8 @@ command=pre-install fi -if [ ! -d "$ETCKEEPER_CONF_DIR/$command.d" ]; then - echo "etckeeper: $ETCKEEPER_CONF_DIR/$command.d does not exist" >&2 +if [ ! -d "$ETCKEEPER_LIB_DIR/$command.d" ] && [ ! -d "$ETCKEEPER_CONF_DIR/$command.d" ]; then + echo "etckeeper: "$ETCKEEPER_LIB_DIR/$command.d" nor $ETCKEEPER_CONF_DIR/$command.d does not exist" >&2 exit 1 fi @@ -122,13 +126,14 @@ lsscripts() { LANG=C perl -e ' - $dir=shift; + for $dir (@ARGV) { print join "\n", grep { ! -d $_ && -x $_ } grep /^\Q$dir\/\E[-a-zA-Z0-9]+$/, glob "$dir/*"; - ' "$1" + } + ' "$@" } -for script in $(lsscripts "$ETCKEEPER_CONF_DIR/$command.d"); do +for script in $(lsscripts "$ETCKEEPER_LIB_DIR/$command.d" "$ETCKEEPER_CONF_DIR/$command.d"); do "$script" "$@" done