From 7b8cd4d4d20a770d8fc8b532a96823947d7c042e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 4 Jan 2008 12:01:49 -0500 Subject: rework tests slightly, test for debconf directly --- pre-install.d/50uncommitted-changes | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'pre-install.d') diff --git a/pre-install.d/50uncommitted-changes b/pre-install.d/50uncommitted-changes index 231eeb1..dd798e7 100755 --- a/pre-install.d/50uncommitted-changes +++ b/pre-install.d/50uncommitted-changes @@ -1,11 +1,9 @@ #!/bin/sh set -e -. /etc/etckeeper/etckeeper.conf - if [ -d .git ] && ! LANG=C git-status 2>&1 | grep -q "working directory clean"; then RET="true" - if [ "$HIGHLEVEL_PACKAGE_MANAGER" = "apt" ]; then + if [ -e /usr/share/debconf/confmodule ]; then . /usr/share/debconf/confmodule db_capb escape db_title etckeeper @@ -19,17 +17,17 @@ if [ -d .git ] && ! LANG=C git-status 2>&1 | grep -q "working directory clean"; if [ "$RET" = true ]; then git add . if ! git commit $GIT_COMMIT_OPTIONS -m "saving uncommitted changes in /etc prior to $HIGHLEVEL_PACKAGE_MANAGER run"; then - if [ "$HIGHLEVEL_PACKAGE_MANAGER" = "apt" ]; then + if [ -e /usr/share/debconf/confmodule ]; then db_input critical etckeeper/commit_failed || true db_go || true db_reset etckeeper/commit_failed || true - elif [ "$HIGHLEVE_PACKAGE_MANAGER" = "pacman-g2" ]; then + else echo "error: etckeeper failed to commit changes in /etc using git (git commit failed)" exit 1 fi fi fi - if [ "$HIGHLEVEL_PACKAGE_MANAGER" = "apt" ]; then + if [ -e /usr/share/debconf/confmodule ]; then db_reset etckeeper/unclean || true fi fi -- cgit v1.2.3