From a3f643fc9d8fc4b45c1bed3cfa8415afb9eb3873 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 7 Jun 2008 16:11:59 -0400 Subject: Add a AVOID_COMMIT_BEFORE_INSTALL option in the config file to make it easy to configure etckeeper to abort an installation if there are uncommitted changes in /etc. Closes: #478754 --- pre-install.d/50uncommitted-changes | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pre-install.d') diff --git a/pre-install.d/50uncommitted-changes b/pre-install.d/50uncommitted-changes index d06883d..465b06c 100755 --- a/pre-install.d/50uncommitted-changes +++ b/pre-install.d/50uncommitted-changes @@ -10,6 +10,10 @@ if [ "$1" = "fail-debconf" ]; then fi if etckeeper unclean; then + if [ ! "$AVOID_COMMIT_BEFORE_INSTALL" ]; then + echo "error: etckeeper detected uncommitted changes in /etc prior to $HIGHLEVEL_PACKAGE_MANAGER run" >&2 + exit 1 + fi if ! etckeeper commit "saving uncommitted changes in /etc prior to $HIGHLEVEL_PACKAGE_MANAGER run"; then if [ -e /usr/share/debconf/confmodule ]; then $0 fail-debconf -- cgit v1.2.3