[Frugalware-git] pacman-tools: add sample pacman-g2 hook for repoman upgrade

Miklos Vajna vmiklos at frugalware.org
Thu Jan 7 22:13:28 CET 2010


Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-tools.git;a=commitdiff;h=5adee2c5bb671822f29193bd81b1f0b8e8a1718f

commit 5adee2c5bb671822f29193bd81b1f0b8e8a1718f
Author: Miklos Vajna <vmiklos at frugalware.org>
Date:   Thu Jan 7 22:13:58 2010 +0100

add sample pacman-g2 hook for repoman upgrade

diff --git a/Makefile b/Makefile
index 3f2b923..a5ff177 100644
--- a/Makefile
+++ b/Makefile
@@ -57,7 +57,7 @@ install: compile
$(INSTALL) -d $(DESTDIR)$(man8dir)
$(INSTALL) -d $(DESTDIR)$(sysconfdir)
$(INSTALL) -d $(DESTDIR)$(sysconfdir)/repoman.d
-	$(INSTALL) -d $(DESTDIR)$(docdir)
+	$(INSTALL) -d $(DESTDIR)$(docdir)/hooks
$(INSTALL) -d $(DESTDIR)/home/syncpkgd
chown syncpkgd:daemon $(DESTDIR)/home/syncpkgd
$(INSTALL) -m755 $(PROGRAMS) $(DESTDIR)$(bindir)
@@ -71,6 +71,7 @@ install: compile
$(INSTALL) etcconfig.py $(DESTDIR)$(sbindir)/etcconfig
$(INSTALL) mkiso/mkiso $(DESTDIR)$(bindir)/mkiso
$(INSTALL) -m644 mkiso/volumes.xml $(DESTDIR)$(docdir)/volumes.xml
+	$(INSTALL) -m644 hooks/* $(DESTDIR)$(docdir)/hooks
ifneq ($(FINCDIR),)
$(INSTALL) -m644 apidocs/*.3 $(DESTDIR)$(man3dir)
endif
diff --git a/hooks/README b/hooks/README
new file mode 100644
index 0000000..b63e3be
--- /dev/null
+++ b/hooks/README
@@ -0,0 +1,8 @@
+The Pacman-G2 hooks in this directory are disabled by default. If you
+want to enable one of them, then run:
+
+# cd /etc/pacman-g2/hooks
+# cp /usr/share/doc/pacman-tools-*/hooks/foo .
+
+The comments at the top of each hook gives you a brief summary about
+what does it do.
diff --git a/hooks/repoman-upgrade b/hooks/repoman-upgrade
new file mode 100644
index 0000000..faf8fe3
--- /dev/null
+++ b/hooks/repoman-upgrade
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+#
+# Runs 'repoman upd; repoman --dry-run upgrade' after each
+# 'pacman-g2 -Syu' so that you won't forget to run
+# 'repoman upgrade' if it's necessary to do so.
+#
+
+post_sysupgrade()
+{
+	repoman upd
+	repoman --dry-run upgrade
+}
+
+op=$1
+shift
+$op $*


More information about the Frugalware-git mailing list