$NetBSD: patch-post-install.d_50vcs-commit,v 1.8 2025/08/18 02:47:16 schmonz Exp $ Add SUBST_VARS token. --- post-install.d/50vcs-commit.orig 2025-08-16 16:22:02.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" # Find the pid whose parent is the command line that the user ran. # Depending on how the highlevel package manager starts etckeeper, @@ -70,7 +70,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 @@ -83,7 +83,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 @@ -91,7 +91,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")" @@ -100,7 +100,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