summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-01-04 12:01:49 -0500
committerJoey Hess <joey@kodama.kitenet.net>2008-01-04 12:01:49 -0500
commit7b8cd4d4d20a770d8fc8b532a96823947d7c042e (patch)
treea98f1da5c248dabc8523edf259240d53cbe8ae88
parentbf06a9e0ff2ce57a2c00f023a9e2a985f9477c16 (diff)
rework tests slightly, test for debconf directly
-rwxr-xr-xpre-install.d/50uncommitted-changes10
1 files changed, 4 insertions, 6 deletions
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