summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@frugalware.org>2008-01-04 17:17:39 +0100
committerJoey Hess <joey@kodama.kitenet.net>2008-01-04 11:53:08 -0500
commit3ae36d1c7fc9787e335c29075cbae5326575b2c3 (patch)
treec40a11c3435a16d365078191be5375e15b44bd7e
parentb373664446fb85be14e0d264bff25fb8c9a76108 (diff)
Merge branch 'pacman-g2'
Conflicts: Makefile pre-install.d/50uncommitted-changes Additinoal fix: As noted by Joey, we should bail out with an error if git commit fails when using pacman-g2. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
-rw-r--r--Makefile3
-rwxr-xr-xinit.d/50git-ignore8
-rwxr-xr-xpre-install.d/50uncommitted-changes37
3 files changed, 36 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index 23cb3ea..47cc3c9 100644
--- a/Makefile
+++ b/Makefile
@@ -13,3 +13,6 @@ install:
ifeq ($(HIGHLEVEL_PACKAGE_MANAGER),apt))
install -m 0644 -D apt.conf $(PREFIX)/etc/apt/apt.conf.d/05etckeeper
endif
+ifeq ($(HIGHLEVEL_PACKAGE_MANAGER),pacman-g2))
+ install -m 0644 -D pacman-g2.hook $(PREFIX)/etc/pacman-g2/hooks/etckeeper
+endif
diff --git a/init.d/50git-ignore b/init.d/50git-ignore
index de58ed5..778774e 100755
--- a/init.d/50git-ignore
+++ b/init.d/50git-ignore
@@ -7,6 +7,14 @@ if [ ! -e .gitignore ]; then
*.dpkg-*
EOF
fi
+ if [ "$LOWLEVEL_PACKAGE_MANAGER" = "pacman-g2" ]; then
+ cat >.gitignore <<EOF
+# new and old versions of conffiles, stored by pacman
+*.pacnew
+*.pacorig
+*.pacsave
+EOF
+ fi
cat >>.gitignore <<EOF
*~
diff --git a/pre-install.d/50uncommitted-changes b/pre-install.d/50uncommitted-changes
index f8811ad..231eeb1 100755
--- a/pre-install.d/50uncommitted-changes
+++ b/pre-install.d/50uncommitted-changes
@@ -1,22 +1,35 @@
#!/bin/sh
set -e
+
+. /etc/etckeeper/etckeeper.conf
+
if [ -d .git ] && ! LANG=C git-status 2>&1 | grep -q "working directory clean"; then
- . /usr/share/debconf/confmodule
- db_capb escape
- db_title etckeeper
+ RET="true"
+ if [ "$HIGHLEVEL_PACKAGE_MANAGER" = "apt" ]; then
+ . /usr/share/debconf/confmodule
+ db_capb escape
+ db_title etckeeper
- db_reset etckeeper/unclean || true
- db_subst etckeeper/unclean STATUS $(git-status | debconf-escape -e) || true
- db_input critical etckeeper/unclean || true
- db_go || true
- db_get etckeeper/unclean
+ db_reset etckeeper/unclean || true
+ db_subst etckeeper/unclean STATUS $(git-status | debconf-escape -e) || true
+ db_input critical etckeeper/unclean || true
+ db_go || true
+ db_get etckeeper/unclean
+ fi
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
- db_input critical etckeeper/commit_failed || true
- db_go || true
- db_reset etckeeper/commit_failed || true
+ if [ "$HIGHLEVEL_PACKAGE_MANAGER" = "apt" ]; then
+ db_input critical etckeeper/commit_failed || true
+ db_go || true
+ db_reset etckeeper/commit_failed || true
+ elif [ "$HIGHLEVE_PACKAGE_MANAGER" = "pacman-g2" ]; then
+ echo "error: etckeeper failed to commit changes in /etc using git (git commit failed)"
+ exit 1
+ fi
fi
fi
- db_reset etckeeper/unclean || true
+ if [ "$HIGHLEVEL_PACKAGE_MANAGER" = "apt" ]; then
+ db_reset etckeeper/unclean || true
+ fi
fi