[Fusionforge-commits] FusionForge branch GUM updated. 4fda77ba9f0138d40a6933c195e7912034ed0d48

Sylvain Beucler beuc-inria at fusionforge.org
Mon Sep 1 15:26:15 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  4fda77ba9f0138d40a6933c195e7912034ed0d48 (commit)
       via  7636c66254a1468ef94ae8202b631c66203e93eb (commit)
       via  094b05595187c5031a519da93ab0d57f80317d59 (commit)
       via  1764cda32b8f7e25ce5c00a002152984cf8b3683 (commit)
      from  3a6d4ab155596230a3847579666a35dc5d1e00c6 (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 4fda77ba9f0138d40a6933c195e7912034ed0d48
Author: Sylvain Beucler <sylvain.beucler at inria.fr>
Date:   Mon Sep 1 15:25:36 2014 +0200

    mediawiki: fix install and testsuite

diff --git a/src/debian/fusionforge-plugin-mediawiki.triggers b/src/debian/fusionforge-plugin-mediawiki.triggers
new file mode 100644
index 0000000..c26b041
--- /dev/null
+++ b/src/debian/fusionforge-plugin-mediawiki.triggers
@@ -0,0 +1,3 @@
+# Triggers for fusionforge-plugin-mediawiki
+interest /usr/share/mediawiki
+interest /usr/share/mediawiki-extensions
diff --git a/src/debian/plugin.postinst b/src/debian/plugin.postinst
index 99d03b3..65c7e5b 100644
--- a/src/debian/plugin.postinst
+++ b/src/debian/plugin.postinst
@@ -1,6 +1,8 @@
 #!/bin/sh -e
+pluginctl=$(forge_get_config source_path)/post-install.d/common/plugin.sh
 case "$1" in
-    configure) $(forge_get_config source_path)/post-install.d/common/plugin.sh @plugin@ configure ;;
+    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 ;;
 esac
diff --git a/src/debian/plugin.prerm b/src/debian/plugin.prerm
index 66dbde7..ebe40a8 100644
--- a/src/debian/plugin.prerm
+++ b/src/debian/plugin.prerm
@@ -1,6 +1,7 @@
 #!/bin/sh -e
+pluginctl=$(forge_get_config source_path)/post-install.d/common/plugin.sh
 case "$1" in
-    remove) $(forge_get_config source_path)/post-install.d/common/plugin.sh @plugin@ remove ;;
+    remove) if [ -x $pluginctl ]; then $pluginctl @plugin@ remove; fi ;;
     upgrade|deconfigure|failed-upgrade) ;;
     *) echo "prerm called with unknown argument \`$1'" >&2; exit 1 ;;
 esac
diff --git a/src/plugins/mediawiki/bin/install.sh b/src/plugins/mediawiki/bin/install.sh
new file mode 100755
index 0000000..0f811b1
--- /dev/null
+++ b/src/plugins/mediawiki/bin/install.sh
@@ -0,0 +1,50 @@
+#!/bin/bash -x
+# MediaWiki post-install
+
+config_path=$(forge_get_config config_path)
+data_path=$(forge_get_config data_path)
+plugindir=$(forge_get_config source_path)/plugins/mediawiki
+
+mediawikidir=$((ls -d /usr/share/mediawiki* 2>/dev/null || echo '/usr/share/mediawiki') | tail -1)
+# Debian: /usr/share/mediawiki/
+# CentOS6: /usr/share/mediawiki119/
+
+upgrade_mediawikis () {
+    # Upgrade Mediawiki database schemas
+    $(forge_get_config binary_path)/list-projects-using-plugin.php mediawiki | while read i ; do
+	$(forge_get_config plugins_path)/mediawiki/bin/mw-wrapper.php $i update.php --quick
+    done
+}
+
+case "$1" in
+    configure)
+        ln -nfs $mediawikidir/api.php              $plugindir/www/api.php
+        ln -nfs $mediawikidir/extensions           $plugindir/www/extensions
+        ln -nfs $mediawikidir/img_auth.php         $plugindir/www/img_auth.php
+        ln -nfs $mediawikidir/includes             $plugindir/www/includes
+        ln -nfs $mediawikidir/index.php            $plugindir/www/index.php
+        ln -nfs $mediawikidir/languages            $plugindir/www/languages
+        ln -nfs $mediawikidir/load.php             $plugindir/www/load.php
+        ln -nfs $mediawikidir/maintenance          $plugindir/www/maintenance
+        ln -nfs $mediawikidir/opensearch_desc.php  $plugindir/www/opensearch_desc.php
+        ln -nfs $mediawikidir/profileinfo.php      $plugindir/www/profileinfo.php
+        ln -nfs $mediawikidir/redirect.php         $plugindir/www/redirect.php
+        ln -nfs $mediawikidir/thumb.php            $plugindir/www/thumb.php
+
+	ln -nfs $mediawikidir/skins $plugindir/www/skins
+	ln -nfs $mediawikidir/skins/monobook/headbg.jpg $plugindir/www/themes/css/mw-headbg.jpg
+
+	ln -nfs $mediawikidir $data_path/plugins/mediawiki/master
+	ln -nfs $plugindir/mediawiki-skin/FusionForge.php $mediawikidir/skins/FusionForge.php
+	;;
+    triggered)
+	case $2 in
+	/usr/share/mediawiki*) upgrade_mediawikis ;;
+	esac
+	;;
+    remove)
+	;;
+    *)
+        echo "Usage: $0 {configure|triggered|remove}"
+        exit 1
+esac
diff --git a/src/plugins/moinmoin/bin/install.sh b/src/plugins/moinmoin/bin/install.sh
index b02ca33..d78c2ab 100755
--- a/src/plugins/moinmoin/bin/install.sh
+++ b/src/plugins/moinmoin/bin/install.sh
@@ -19,12 +19,12 @@ case "$1" in
 	    chown $wsgi_user $dataprefix/moinmoin.log
 	fi
 	;;
-    purge)
+    remove)
 	for i in data underlay ; do
 	    rm -rf $prefix/$i
 	done
 	;;
     *)
-        echo "Usage: $0 {configure|purge}"
+        echo "Usage: $0 {configure|remove}"
         exit 1
 esac
diff --git a/src/post-install.d/common/plugin.sh b/src/post-install.d/common/plugin.sh
index 986f0a4..4954841 100755
--- a/src/post-install.d/common/plugin.sh
+++ b/src/post-install.d/common/plugin.sh
@@ -39,6 +39,14 @@ case "$2" in
 	fi
 	;;
 
+    triggered)
+	# Run plugin-specific triggered (e.g. mediawiki)
+	if [ -x $source_path/plugins/$1/bin/install.sh ]; then
+	    echo "Running $source_path/plugins/$1/bin/install.sh triggered"
+	    $source_path/plugins/$1/bin/install.sh triggered "$2"
+	fi
+	;;
+
     remove)
 	# TODO: httpd.conf.d ?
 
diff --git a/tests/func/60_PluginsMediawiki/mediawikiTest.php b/tests/func/60_PluginsMediawiki/mediawikiTest.php
index 8e1d6e3..6afd35f 100644
--- a/tests/func/60_PluginsMediawiki/mediawikiTest.php
+++ b/tests/func/60_PluginsMediawiki/mediawikiTest.php
@@ -62,8 +62,6 @@ And more lorem ipsum too.");
 		$this->assertTrue($this->isTextPresent("lorem ipsum"));
 		$this->assertTrue($this->isElementPresent("//h1[contains(.,'Bleh')]"));
 		$this->assertTrue($this->isElementPresent("//h2[contains(.,'Blahblah')]"));
-
-		system("rm -rf /var/lib/gforge/plugins/mediawiki/projects/projecta/");
 	}
 }
 
diff --git a/tests/func/db_reload.sh b/tests/func/db_reload.sh
index 1d401d2..c20c4d7 100755
--- a/tests/func/db_reload.sh
+++ b/tests/func/db_reload.sh
@@ -126,6 +126,7 @@ else
     exit 1
 fi
 
+# SCM
 for i in arch bzr cvs darcs git hg svn ; do
     repopath=`FUSIONFORGE_NO_PLUGINS=true forge_get_config repos_path scm$i`
     if [ -d "$repopath" ] && ls $repopath | grep -q .. ; then
@@ -133,6 +134,8 @@ for i in arch bzr cvs darcs git hg svn ; do
 	rm -rf $repopath/*
     fi
 done
+# Wikis
+rm -rf $(forge_get_config data_path)/plugins/mediawiki/projects/*
 
 # If the backup is there, restore it (it should now have been created by install.sh)
 if [ -d $dbdir.backup ]; then

commit 7636c66254a1468ef94ae8202b631c66203e93eb
Author: Sylvain Beucler <sylvain.beucler at inria.fr>
Date:   Mon Sep 1 13:55:39 2014 +0200

    install: harden uninstall scripts

diff --git a/tests/scripts/deb/uninstall.sh b/tests/scripts/deb/uninstall.sh
index 625a24f..c22b124 100755
--- a/tests/scripts/deb/uninstall.sh
+++ b/tests/scripts/deb/uninstall.sh
@@ -1,4 +1,5 @@
 #!/bin/bash
 # Aggressive desinstall for testing a clean re-install
-aptitude purge ~nforge ~npostgres ~nnss-pgsql ~napache2 ~nphp ~npostfix ~nexim4 && rm -rf /usr/share/gforge/ /etc/fusionforge/
-rm -rf /root/dump /var/lib/postgresql.backup/
+aptitude purge ~nforge ~npostgres ~nnss-pgsql ~napache2 ~nphp ~npostfix ~nexim4
+rm -rf /usr/share/gforge/ /etc/fusionforge/ /var/lib/fusionforge/
+rm -rf /root/dump /var/lib/postgresql*/
diff --git a/tests/scripts/rpm/uninstall.sh b/tests/scripts/rpm/uninstall.sh
index 4a9f31d..f362410 100755
--- a/tests/scripts/rpm/uninstall.sh
+++ b/tests/scripts/rpm/uninstall.sh
@@ -2,4 +2,5 @@
 # Aggressive desinstall for testing a clean re-install
 yum remove -y 'fusionforge*'
 service postgresql stop
-rm -rf /var/lib/pgsql/ /usr/share/fusionforge/ /etc/fusionforge/ /var/lib/fusionforge/
+rm -rf  /usr/share/fusionforge/ /etc/fusionforge/ /var/lib/fusionforge/
+rm -rf  /root/dump /var/lib/pgsql*/

commit 094b05595187c5031a519da93ab0d57f80317d59
Author: Sylvain Beucler <sylvain.beucler at inria.fr>
Date:   Mon Sep 1 13:55:15 2014 +0200

    install: db: grant schema creation privs

diff --git a/src/post-install.d/db/populate.sh b/src/post-install.d/db/populate.sh
index 2ba4d93..88f60f6 100755
--- a/src/post-install.d/db/populate.sh
+++ b/src/post-install.d/db/populate.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash -e
 # Create user and database, and import initial data
 
 database_host=$(forge_get_config database_host)
@@ -19,20 +19,21 @@ if su - postgres -c "psql $database_name" </dev/null 2>/dev/null; then
     exit 0
 fi
 
+# Create database
+su - postgres -c "createdb --template template0 --encoding UNICODE $database_name"
+if ! su - postgres -c "createlang -l $database_name" | grep -q plpgsql; then \
+    su - postgres -c "createlang plpgsql $database_name"; \
+fi
+
 # Create DB user
 su - postgres -c "createuser -SDR $database_user"
 database_password_quoted=$(echo $database_password | sed -e "s/'/''/")
 su - postgres -c psql <<EOF
-ALTER ROLE $database_user WITH PASSWORD '$database_password_quoted' ;
+ALTER ROLE $database_user WITH PASSWORD '$database_password_quoted';
+GRANT CREATE ON DATABASE $database_name TO $database_user;  -- for wiki schemas
 EOF
 su - postgres -c "createuser -SDR ${database_user}_nss"
 
-# Create database
-su - postgres -c "createdb --template template0 --encoding UNICODE $database_name"
-if ! su - postgres -c "createlang -l $database_name" | grep -q plpgsql; then \
-    su - postgres -c "createlang plpgsql $database_name"; \
-fi
-
 export PGPASSFILE=$(mktemp)
 cat <<EOF > $PGPASSFILE
 $database_host:$database_port:$database_name:$database_user:$database_password

commit 1764cda32b8f7e25ce5c00a002152984cf8b3683
Author: Sylvain Beucler <sylvain.beucler at inria.fr>
Date:   Mon Sep 1 13:54:57 2014 +0200

    install: install env.inc.php for plugins

diff --git a/src/GNUmakefile b/src/GNUmakefile
index 7b80eea..80289f1 100644
--- a/src/GNUmakefile
+++ b/src/GNUmakefile
@@ -45,6 +45,7 @@ install-common: install-config install-plugin-authbuiltin
 	$(CP_R) VERSION bin common templates lib $(DESTDIR)$(pkgdatadir)/
 	$(CP_R) cronjobs/scm $(DESTDIR)$(pkgdatadir)/cronjobs/  # no dedicated 'scm' package now
 	$(CP_R) post-install.d/common $(DESTDIR)$(pkgdatadir)/post-install.d/
+	$(CP_R) plugins/env.inc.php $(DESTDIR)$(pkgdatadir)/plugins/
 	$(INSTALL) -d -m 00755 $(DESTDIR)$(prefix)/bin/
 	ln -nfs $(pkgdatadir)/bin/forge_get_config $(DESTDIR)$(prefix)/bin/
 	ln -nfs $(pkgdatadir)/bin/forge_run_job $(DESTDIR)$(prefix)/bin/

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

Summary of changes:
 src/GNUmakefile                                    |    1 +
 .../fusionforge-plugin-mediawiki.triggers}         |    2 +-
 src/debian/plugin.postinst                         |    4 +-
 src/debian/plugin.prerm                            |    3 +-
 src/plugins/mediawiki/bin/install.sh               |   50 ++++++++++++++++++++
 src/plugins/moinmoin/bin/install.sh                |    4 +-
 src/post-install.d/common/plugin.sh                |    8 ++++
 src/post-install.d/db/populate.sh                  |   17 +++----
 tests/func/60_PluginsMediawiki/mediawikiTest.php   |    2 -
 tests/func/db_reload.sh                            |    3 ++
 tests/scripts/deb/uninstall.sh                     |    5 +-
 tests/scripts/rpm/uninstall.sh                     |    3 +-
 12 files changed, 84 insertions(+), 18 deletions(-)
 copy src/{plugins/mediawiki/packaging/triggers/plugin-mediawiki => debian/fusionforge-plugin-mediawiki.triggers} (61%)
 create mode 100755 src/plugins/mediawiki/bin/install.sh


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list