summaryrefslogtreecommitdiff
path: root/pre-install.d
diff options
context:
space:
mode:
Diffstat (limited to 'pre-install.d')
-rwxr-xr-xpre-install.d/50uncommitted-changes29
1 files changed, 2 insertions, 27 deletions
diff --git a/pre-install.d/50uncommitted-changes b/pre-install.d/50uncommitted-changes
index bc33ff9..4e573dc 100755
--- a/pre-install.d/50uncommitted-changes
+++ b/pre-install.d/50uncommitted-changes
@@ -1,14 +1,6 @@
#!/bin/sh
set -e
-unclean() {
- if [ "$VCS" = git ]; then
- [ -d .git ] && ! LANG=C git-status 2>&1 | grep -q "working directory clean"
- elif [ "$VCS" = hg ]; then
- [ -d .hg ] && ! hg status 2>&1 | wc -l | grep -q "^0$"
- fi
-}
-
status() {
if [ "$VCS" = git ]; then
git status
@@ -17,23 +9,6 @@ status() {
fi
}
-commit() {
- message="$1"
-
- if [ "$VCS" = git ]; then
- git add .
- for file in $(git ls-files --deleted); do
- if [ ! -d "$file" ]; then
- git rm --quiet "$file"
- fi
- done
- git commit $GIT_COMMIT_OPTIONS -m "$message"
- elif [ "$VCS" = hg ]; then
- hg addremove .
- hg commit $HG_COMMIT_OPTIONS -m "$message"
- fi
-}
-
if [ "$1" = "ask-debconf" ]; then
. /usr/share/debconf/confmodule
db_capb escape
@@ -60,7 +35,7 @@ elif [ "$1" = "fail-debconf" ]; then
db_reset etckeeper/commit_failed || true
fi
-if unclean; then
+if etckeeper unclean; then
docommit="true"
if [ -e /usr/share/debconf/confmodule ]; then
if $0 ask-debconf; then
@@ -70,7 +45,7 @@ if unclean; then
fi
fi
if [ "$docommit" = true ]; then
- if ! commit "saving uncommitted changes in /etc prior to $HIGHLEVEL_PACKAGE_MANAGER run"; then
+ 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
else