summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTilman Blumenbach <tilman+git@ax86.net>2016-01-30 20:43:55 +0100
committerJoey Hess <joeyh@joeyh.name>2016-02-02 12:11:16 -0400
commitba00b0240201ffd004512b19b84c0379a898d5c4 (patch)
tree3aca99d38f117b8e62a46030fa0c7460ccb56d59
parent2d371faabe6d3e92e9c8a4d0dd049df73ddc1d0b (diff)
Add hooks for Pacman 5.
-rw-r--r--Makefile5
-rw-r--r--etckeeper.conf2
-rw-r--r--pacman-post-install.hook14
-rw-r--r--pacman-pre-install.hook15
4 files changed, 35 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 007faae..0ff9a05 100644
--- a/Makefile
+++ b/Makefile
@@ -35,6 +35,11 @@ ifeq ($(HIGHLEVEL_PACKAGE_MANAGER),apt)
mkdir -p $(DESTDIR)$(etcdir)/cruft/filters-unex
$(INSTALL_DATA) cruft_filter $(DESTDIR)$(etcdir)/cruft/filters-unex/etckeeper
endif
+ifeq ($(LOWLEVEL_PACKAGE_MANAGER),pacman)
+ mkdir -p $(DESTDIR)$(prefix)/share/libalpm/hooks
+ $(INSTALL_DATA) ./pacman-pre-install.hook $(DESTDIR)$(prefix)/share/libalpm/hooks/etckeeper-pre-install.hook
+ $(INSTALL_DATA) ./pacman-post-install.hook $(DESTDIR)$(prefix)/share/libalpm/hooks/etckeeper-post-install.hook
+endif
ifeq ($(LOWLEVEL_PACKAGE_MANAGER),pacman-g2)
mkdir -p $(DESTDIR)$(etcdir)/pacman-g2/hooks
$(INSTALL_DATA) pacman-g2.hook $(DESTDIR)$(etcdir)/pacman-g2/hooks/etckeeper
diff --git a/etckeeper.conf b/etckeeper.conf
index 19fc894..0d268bd 100644
--- a/etckeeper.conf
+++ b/etckeeper.conf
@@ -30,7 +30,7 @@ DARCS_COMMIT_OPTIONS="-a"
#AVOID_COMMIT_BEFORE_INSTALL=1
# The high-level package manager that's being used.
-# (apt, pacman-g2, yum, dnf, zypper etc)
+# (apt, pacman, pacman-g2, yum, dnf, zypper etc)
HIGHLEVEL_PACKAGE_MANAGER=apt
# The low-level package manager that's being used.
diff --git a/pacman-post-install.hook b/pacman-post-install.hook
new file mode 100644
index 0000000..f3e0671
--- /dev/null
+++ b/pacman-post-install.hook
@@ -0,0 +1,14 @@
+# etckeeper post-install hook for Pacman 5 and newer
+
+[Trigger]
+Operation = Install
+Operation = Upgrade
+Operation = Remove
+Type = Package
+Target = *
+
+[Action]
+Description = etckeeper post-install hook
+When = PostTransaction
+Exec = /usr/bin/etckeeper post-install
+Depends = etckeeper
diff --git a/pacman-pre-install.hook b/pacman-pre-install.hook
new file mode 100644
index 0000000..7d636dc
--- /dev/null
+++ b/pacman-pre-install.hook
@@ -0,0 +1,15 @@
+# etckeeper pre-install hook for Pacman 5 and newer
+
+[Trigger]
+Operation = Install
+Operation = Upgrade
+Operation = Remove
+Type = Package
+Target = *
+
+[Action]
+Description = etckeeper pre-install hook
+When = PreTransaction
+Exec = /usr/bin/etckeeper pre-install
+Depends = etckeeper
+AbortOnFail