summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-01-07 13:46:21 -0500
committerJoey Hess <joey@kodama.kitenet.net>2008-01-07 13:46:21 -0500
commit1e4dd3b87be8e06dd0ae1c4b2c250591b615a2e1 (patch)
tree21dae573cc194411593d43afa3025b80b3188891
parent82cbf4298c6cc347bd33ce4379cc9234cf2bc926 (diff)
* Separate debconf use from the main flow of the script so the commit
stage can use editors etc. Closes: #459547 * Remove the hint about setting -e to get interactive commits, since I don't want to encourage users to do that. (For one thing, it's unlikely to work if a graphical package manager is used..)
-rw-r--r--debian/changelog10
-rw-r--r--etckeeper.conf4
-rwxr-xr-xpre-install.d/50uncommitted-changes53
3 files changed, 45 insertions, 22 deletions
diff --git a/debian/changelog b/debian/changelog
index 24df11c..4bfd1d2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+etckeeper (0.9) UNRELEASED; urgency=low
+
+ * Separate debconf use from the main flow of the script so the commit
+ stage can use editors etc. Closes: #459547
+ * Remove the hint about setting -e to get interactive commits, since
+ I don't want to encourage users to do that. (For one thing, it's unlikely
+ to work if a graphical package manager is used..)
+
+ -- Joey Hess <joeyh@debian.org> Mon, 07 Jan 2008 13:44:40 -0500
+
etckeeper (0.8) unstable; urgency=low
* Typo fixes from Miklos Vajna
diff --git a/etckeeper.conf b/etckeeper.conf
index 4cf5f58..bd07ea7 100644
--- a/etckeeper.conf
+++ b/etckeeper.conf
@@ -3,9 +3,7 @@
VCS="git"
# Options passed to git commit when run by etckeeper.
-# You could for exemple use "-e" if you want to edit all commit messages
-# before committing.
-#GIT_COMMIT_OPTIONS="-e"
+#GIT_COMMIT_OPTIONS=""
# Options passed to hg commit when run by etckeeper.
#HG_COMMIT_OPTIONS=""
diff --git a/pre-install.d/50uncommitted-changes b/pre-install.d/50uncommitted-changes
index f4c0f0f..bc33ff9 100755
--- a/pre-install.d/50uncommitted-changes
+++ b/pre-install.d/50uncommitted-changes
@@ -34,34 +34,49 @@ commit() {
fi
}
+if [ "$1" = "ask-debconf" ]; then
+ . /usr/share/debconf/confmodule
+ db_capb escape
+ db_title etckeeper
+
+ db_reset etckeeper/unclean || true
+ db_subst etckeeper/unclean VCS "$VCS"
+ db_subst etckeeper/unclean STATUS $(status | debconf-escape -e) || true
+ db_input critical etckeeper/unclean || true
+ db_go || true
+ db_get etckeeper/unclean
+ val="$RET"
+ db_reset etckeeper/unclean || true
+ if [ "$val" = true ]; then
+ exit 0
+ else
+ exit 1
+ fi
+elif [ "$1" = "fail-debconf" ]; then
+ . /usr/share/debconf/confmodule
+ db_subst etckeeper/commit_failed VCS "$VCS"
+ db_input critical etckeeper/commit_failed || true
+ db_go || true
+ db_reset etckeeper/commit_failed || true
+fi
+
if unclean; then
- RET="true"
+ docommit="true"
if [ -e /usr/share/debconf/confmodule ]; then
- . /usr/share/debconf/confmodule
- db_capb escape
- db_title etckeeper
-
- db_reset etckeeper/unclean || true
- db_subst etckeeper/unclean VCS "$VCS"
- db_subst etckeeper/unclean STATUS $(status | debconf-escape -e) || true
- db_input critical etckeeper/unclean || true
- db_go || true
- db_get etckeeper/unclean
+ if $0 ask-debconf; then
+ docommit=true
+ else
+ docommit=false
+ fi
fi
- if [ "$RET" = true ]; then
+ if [ "$docommit" = true ]; then
if ! commit "saving uncommitted changes in /etc prior to $HIGHLEVEL_PACKAGE_MANAGER run"; then
if [ -e /usr/share/debconf/confmodule ]; then
- db_subst etckeeper/commit_failed VCS "$VCS"
- db_input critical etckeeper/commit_failed || true
- db_go || true
- db_reset etckeeper/commit_failed || true
+ $0 fail-debconf
else
echo "error: etckeeper failed to commit changes in /etc using $VCS"
exit 1
fi
fi
fi
- if [ -e /usr/share/debconf/confmodule ]; then
- db_reset etckeeper/unclean || true
- fi
fi