[Fusionforge-commits] FusionForge branch GUM updated. 0269b2449f0f47742afc1eb1d536fbcb37f59852

Sylvain Beucler beuc-inria at fusionforge.org
Wed Sep 3 10:41:46 CEST 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, GUM has been updated
       via  0269b2449f0f47742afc1eb1d536fbcb37f59852 (commit)
      from  a24d2ef06a6e17e509af7f5cae0286e584ba73ed (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 0269b2449f0f47742afc1eb1d536fbcb37f59852
Author: Sylvain Beucler <sylvain.beucler at inria.fr>
Date:   Wed Sep 3 10:40:57 2014 +0200

    install: plugins: support 2-step conffiles+exec install -> ucf support in debian

diff --git a/src/debian/gen_control.sh b/src/debian/gen_control.sh
index 1c92975..711cd8d 100755
--- a/src/debian/gen_control.sh
+++ b/src/debian/gen_control.sh
@@ -24,7 +24,7 @@
     for i in $(sed -n 's/^Package: fusionforge-plugin-//p' debian/plugins); do
 	sed -n -e '/^#/d' -e "/^Package: fusionforge-plugin-$i/,/^$/p" debian/plugins \
 	    | grep -v ^$ \
-	    | sed 's/Depends:\(.*\)/Depends: fusionforge-common (=${source:Version}),\1, ${misc:Depends}/'
+	    | sed 's/Depends:\(.*\)/Depends: fusionforge-common (=${source:Version}),\1, ucf, ${misc:Depends}/'
 	echo "Architecture: all"
 	php utils/plugin_pkg_desc.php $i deb
 	echo
diff --git a/src/debian/plugin.postinst b/src/debian/plugin.postinst
index 65c7e5b..e80df79 100644
--- a/src/debian/plugin.postinst
+++ b/src/debian/plugin.postinst
@@ -1,10 +1,34 @@
 #!/bin/sh -e
+
+# Skip if plugin.sh was already removed
 pluginctl=$(forge_get_config source_path)/post-install.d/common/plugin.sh
+if [ ! -x $pluginctl ]; then exit 0; fi
+
 case "$1" in
-    configure) if [ -x $pluginctl ]; then $pluginctl @plugin@ configure; fi ;;
-    triggered) if [ -x $pluginctl ]; then $pluginctl @plugin@ triggered "$2"; fi ;;
-    abort-upgrade|abort-remove|abort-deconfigure) ;;
-    *) echo "postinst called with unknown argument \`$1'" >&2; exit 1 ;;
+    configure)
+	DESTDIR=$(mktemp -d)
+	$pluginctl @plugin@ configure-conffiles $DESTDIR
+	for i in $(find $DESTDIR -type f); do
+	    ucf $i ${i#$DESTDIR}
+	    ucfr -f fusionforge-plugin- at plugin@ ${i#$DESTDIR}
+	done
+	rm -rf $DESTDIR/
+	$pluginctl @plugin@ configure-exec
+	;;
+
+    triggered)
+	$pluginctl @plugin@ triggered "$2"
+	;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+	;;
+
+    *)
+	echo "postinst called with unknown argument \`$1'" >&2
+	exit 1
+	;;
 esac
+
 #DEBHELPER#
+
 exit 0
diff --git a/src/debian/plugin.postrm b/src/debian/plugin.postrm
new file mode 100644
index 0000000..6113ab4
--- /dev/null
+++ b/src/debian/plugin.postrm
@@ -0,0 +1,24 @@
+#!/bin/sh -e
+
+case "$1" in
+    purge)
+	ucfq fusionforge- at plugin@ --with-colons \
+	    | while IFS=: read i ignored; do
+	    rm -f $i $i.ucf-*
+	    ucf --purge $i
+	    ucfr --purge fusionforge- at plugin@ $i
+	done
+	;;
+
+    remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+	;;
+
+    *)
+        echo "postrm called with unknown argument \`$1'" >&2
+        exit 1
+	;;
+esac
+
+#DEBHELPER#
+
+exit 0
diff --git a/src/debian/plugins b/src/debian/plugins
index 909b6c6..d008d54 100644
--- a/src/debian/plugins
+++ b/src/debian/plugins
@@ -73,6 +73,8 @@ Depends:
 Package: fusionforge-plugin-projectlabels
 Depends:
 
+# Note: scmhook might need to be manually packaged to allow installing
+# the commit hooks on a separate SCM server
 Package: fusionforge-plugin-scmhook
 Depends: php5-cli, libphp-snoopy
 
diff --git a/src/debian/rules b/src/debian/rules
index f24d052..76505e7 100755
--- a/src/debian/rules
+++ b/src/debian/rules
@@ -31,8 +31,9 @@ override_dh_auto_install:
 	make install-lists       prefix=/usr DESTDIR=$(CURDIR)/debian/fusionforge-lists
 	for i in $$(sed -n 's/^Package: fusionforge-plugin-//p' debian/plugins); do \
 		make install-plugin-$$i prefix=/usr DESTDIR=$(CURDIR)/debian/fusionforge-plugin-$$i; \
-		sed "s/@plugin@/$$i/" debian/plugin.postinst > debian/fusionforge-plugin-$$i.postinst; \
-		sed "s/@plugin@/$$i/" debian/plugin.prerm > debian/fusionforge-plugin-$$i.prerm; \
+		sed "s/@plugin@/$$i/" debian/plugin.postinst>debian/fusionforge-plugin-$$i.postinst; \
+		sed "s/@plugin@/$$i/" debian/plugin.prerm  > debian/fusionforge-plugin-$$i.prerm; \
+		sed "s/@plugin@/$$i/" debian/plugin.postrm > debian/fusionforge-plugin-$$i.postrm; \
 	done
 
 override_dh_clean:
diff --git a/src/post-install.d/common/plugin.sh b/src/post-install.d/common/plugin.sh
index f1f229a..fc62fad 100755
--- a/src/post-install.d/common/plugin.sh
+++ b/src/post-install.d/common/plugin.sh
@@ -28,6 +28,30 @@ fi
 
 case "$2" in
     configure)
+	$0 $1 configure-conffiles
+	$0 $1 configure-exec
+	;;
+
+    configure-conffiles)
+	# Restart apache if there is some change in config
+	if [ ! -d $source_path/plugins/$1/etc/httpd.conf.d/ ]; then exit; fi
+	
+	# Distros may want to install new conffiles using tools such as ucf(1)
+	DESTDIR=$3
+	mkdir -m 755 -p $DESTDIR$config_path/httpd.conf.d/
+	
+	cd $source_path/plugins/$1/etc/
+	for i in $(ls httpd.conf.d/*); do
+	    if [ ! -e $DESTDIR$config_path/$i ]; then
+		$source_path/post-install.d/web/expand-conf.php $i $DESTDIR$config_path/$i
+	    fi
+	    case $i in
+		*secrets*) chmod 600 $DESTDIR$config_path/$i;;
+	    esac
+	done
+	;;
+
+    configure-exec)
 	# Enable plugin
 	$source_path/bin/forge pluginActivate $1
 
@@ -35,28 +59,17 @@ case "$2" in
 	if [ -x $source_path/post-install.d/db/upgrade.php ]; then
 	    $source_path/post-install.d/db/upgrade.php $1
 	fi
-	
-	# Restart apache if there is some change in config
-	(
-	    if [ ! -e $source_path/plugins/$1/etc/httpd.conf.d/ ]; then exit; fi
-	    cd $source_path/plugins/$1/etc/
-	    for i in $(ls httpd.conf.d/*); do
-		if [ ! -e $config_path/$i ]; then
-		    $source_path/post-install.d/web/expand-conf.php $i $config_path/$i
-		fi
-		case $i in
-		    *secrets*) chmod 600 $config_path/$i;;
-		esac
-	    done
-	    # Hard-coded detection of distro-specific Apache conf layout
-	    service $apache_service reload >/dev/null || true
-	)
 
 	# Run plugin-specific install
 	if [ -x $source_path/plugins/$1/bin/install.sh ]; then
 	    echo "Running $source_path/plugins/$1/bin/install.sh configure"
 	    $source_path/plugins/$1/bin/install.sh configure
 	fi
+
+	# Restart Apache if new conffiles were added
+	if [ ! -d $source_path/plugins/$1/etc/httpd.conf.d/ ]; then
+	    service $apache_service reload >/dev/null || true
+	fi
 	;;
 
     triggered)

-----------------------------------------------------------------------

Summary of changes:
 src/debian/gen_control.sh           |    2 +-
 src/debian/plugin.postinst          |   32 +++++++++++++++++++++----
 src/debian/plugin.postrm            |   24 +++++++++++++++++++
 src/debian/plugins                  |    2 ++
 src/debian/rules                    |    5 ++--
 src/post-install.d/common/plugin.sh |   45 ++++++++++++++++++++++-------------
 6 files changed, 87 insertions(+), 23 deletions(-)
 create mode 100644 src/debian/plugin.postrm


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list