diff options
-rw-r--r-- | debian/changelog | 10 | ||||
-rw-r--r-- | etckeeper.conf | 4 | ||||
-rwxr-xr-x | pre-install.d/50uncommitted-changes | 53 |
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 |