$NetBSD: patch-post-install.d_50vcs-commit,v 1.7 2022/12/22 13:40:10 schmonz Exp $ Add SUBST_VARS token. --- post-install.d/50vcs-commit.orig 2022-09-08 16:13:15.000000000 +0000 +++ post-install.d/50vcs-commit @@ -1,7 +1,7 @@ #!/bin/sh set -e -pl="/var/cache/etckeeper/packagelist" +pl="@VARBASE@/cache/etckeeper/packagelist" # Parent process is etckeeper # (Only procps ps is currently supported, others will fail, @@ -56,7 +56,7 @@ get_changed_packages () { if etckeeper unclean; then if [ -z "${ETCKEEPER_PARENT_COMMAND_LINE}" ]; then - message="committing changes in /etc after $HIGHLEVEL_PACKAGE_MANAGER run" + message="committing changes in ${ETCKEEPER_DIR} after $HIGHLEVEL_PACKAGE_MANAGER run" else message="committing changes in /etc made by \"$ETCKEEPER_PARENT_COMMAND_LINE\"" fi @@ -69,7 +69,7 @@ if etckeeper unclean; then get_changed_packages | sort | uniq > $pl.found-pkgs if [ -s $pl.found-pkgs ]; then sed -i 's/^/^[-+]/;s/$/ /' $pl.found-pkgs - etckeeper list-installed | diff -U0 $pl.pre-install - | tail -n+4 | grep -E '^[-+]' | grep -f $pl.found-pkgs > $pl.found-packages + etckeeper list-installed | diff -U0 $pl.pre-install - | tail -n+4 | @EGREP@ '^[-+]' | grep -f $pl.found-pkgs > $pl.found-packages if [ -s $pl.found-packages ]; then echo "Packages with configuration changes:" cat $pl.found-packages || true @@ -77,7 +77,7 @@ if etckeeper unclean; then fi fi echo "Package changes:" - etckeeper list-installed | diff -U0 $pl.pre-install - | tail -n+4 | grep -E '^[-+]' || true + etckeeper list-installed | diff -U0 $pl.pre-install - | tail -n+4 | @EGREP@ '^[-+]' || true ) | etckeeper commit --stdin else etckeeper commit "$(printf "$message")" @@ -86,7 +86,8 @@ if etckeeper unclean; then set -e if [ "$status" != 0 ]; then - echo "warning: etckeeper failed to commit changes in /etc using $VCS" >&2 + echo "warning: etckeeper failed to commit changes in ${ETCKEEPER_DIR} using $VCS" >&2 + fi fi