$NetBSD: patch-etckeeper,v 1.4 2022/12/22 13:40:10 schmonz Exp $

Add SUBST_VARS tokens.

--- etckeeper.orig	2022-09-08 16:13:15.000000000 +0000
+++ etckeeper
@@ -2,7 +2,7 @@
 set -e
 
 if [ -z "$ETCKEEPER_CONF_DIR" ]; then
-	ETCKEEPER_CONF_DIR=/etc/etckeeper
+	ETCKEEPER_CONF_DIR=@PKG_SYSCONFDIR@
 fi
 
 conf="$ETCKEEPER_CONF_DIR/etckeeper.conf"
@@ -84,7 +84,7 @@ elif [ "$command" = "pre-apt" ]; then
 	command=pre-install
 fi
 
-if echo "$command" | LANG=C grep -E -q '[^-a-z_]'; then
+if echo "$command" | LANG=C @EGREP@ -q '[^-a-z_]'; then
 	echo "etckeeper: invalid command $command" >&2
 	exit 1
 fi
@@ -104,7 +104,7 @@ if [ "x$1" = "x-d" ]; then
 fi
 
 if [ -z "$ETCKEEPER_DIR" ]; then
-	ETCKEEPER_DIR=/etc
+	ETCKEEPER_DIR=@PKG_SYSCONFBASEDIR@
 fi
 cd "$ETCKEEPER_DIR"
 export ETCKEEPER_DIR
@@ -127,7 +127,7 @@ export VCS
 
 if command -v perl >/dev/null; then
 	lsscripts() {
-		LANG=C perl -e '
+		LANG=C @PERL5@ -e '
 			$dir=shift;
 			print join "\n", grep { ! -d $_ && -x $_ }
 				grep /^\Q$dir\/\E[-a-zA-Z0-9]+$/,
@@ -142,7 +142,7 @@ else
 	# fallback if perl isn't present
 	for script in $ETCKEEPER_CONF_DIR/$command.d/*; do
 		if [ ! -d "$script" -a -x "$script" ]; then
-			echo "$script" | grep -E -q "/[-a-zA-Z0-9]+$"
+			echo "$script" | @EGREP@ -q "/[-a-zA-Z0-9]+$"
 			[ $? -eq 0 ] && "$script" "$@"
 		fi
 	done
