[Fusionforge-commits] r9651 - in trunk/plugins/coclico: . hudson hudson/bin hudson/cronjobs hudson/debian hudson/debian/dsf-in hudson/debian/po hudson/debian/source hudson/etc hudson/etc/httpd.d hudson/etc/plugins hudson/etc/plugins/hudson hudson/packaging hudson/packaging/control hudson/packaging/dirs hudson/packaging/docs hudson/packaging/install hudson/packaging/links hudson/translations hudson/utils hudson/www hudson/www/admin

Christian Bayle cbayle at libremir.placard.fr.eu.org
Thu Apr 29 17:20:04 CEST 2010


Author: cbayle
Date: 2010-04-29 17:20:03 +0200 (Thu, 29 Apr 2010)
New Revision: 9651

Added:
   trunk/plugins/coclico/hudson/bin/
   trunk/plugins/coclico/hudson/bin/db-delete.pl
   trunk/plugins/coclico/hudson/bin/db-upgrade.pl
   trunk/plugins/coclico/hudson/bin/sayhello
   trunk/plugins/coclico/hudson/cronjobs/
   trunk/plugins/coclico/hudson/cronjobs/manage_hudson.php
   trunk/plugins/coclico/hudson/debian/
   trunk/plugins/coclico/hudson/debian/README.Debian
   trunk/plugins/coclico/hudson/debian/README.source
   trunk/plugins/coclico/hudson/debian/changelog
   trunk/plugins/coclico/hudson/debian/compat
   trunk/plugins/coclico/hudson/debian/control
   trunk/plugins/coclico/hudson/debian/copyright
   trunk/plugins/coclico/hudson/debian/docs
   trunk/plugins/coclico/hudson/debian/dsf-in/
   trunk/plugins/coclico/hudson/debian/dsf-in/plugin-hudson.postinst
   trunk/plugins/coclico/hudson/debian/dsf-in/plugin-hudson.prerm
   trunk/plugins/coclico/hudson/debian/dsf-po/
   trunk/plugins/coclico/hudson/debian/po/
   trunk/plugins/coclico/hudson/debian/po/templates.pot
   trunk/plugins/coclico/hudson/debian/rules
   trunk/plugins/coclico/hudson/debian/source/
   trunk/plugins/coclico/hudson/debian/source/format
   trunk/plugins/coclico/hudson/etc/
   trunk/plugins/coclico/hudson/etc/httpd.d/
   trunk/plugins/coclico/hudson/etc/httpd.d/62plugin-hudson
   trunk/plugins/coclico/hudson/etc/plugins/
   trunk/plugins/coclico/hudson/etc/plugins/hudson/
   trunk/plugins/coclico/hudson/etc/plugins/hudson/config.php
   trunk/plugins/coclico/hudson/packaging/
   trunk/plugins/coclico/hudson/packaging/control/
   trunk/plugins/coclico/hudson/packaging/control/000source
   trunk/plugins/coclico/hudson/packaging/control/222plugin-hudson
   trunk/plugins/coclico/hudson/packaging/control/222plugin-hudson.shortdesc
   trunk/plugins/coclico/hudson/packaging/cron.d/
   trunk/plugins/coclico/hudson/packaging/dirs/
   trunk/plugins/coclico/hudson/packaging/dirs/plugin-hudson
   trunk/plugins/coclico/hudson/packaging/docs/
   trunk/plugins/coclico/hudson/packaging/docs/plugin-hudson
   trunk/plugins/coclico/hudson/packaging/install/
   trunk/plugins/coclico/hudson/packaging/install/plugin-hudson
   trunk/plugins/coclico/hudson/packaging/links/
   trunk/plugins/coclico/hudson/packaging/links/plugin-hudson
   trunk/plugins/coclico/hudson/translations/
   trunk/plugins/coclico/hudson/translations/en.po
   trunk/plugins/coclico/hudson/translations/gforge.pot
   trunk/plugins/coclico/hudson/utils/
   trunk/plugins/coclico/hudson/utils/manage-translations.sh
   trunk/plugins/coclico/hudson/www/admin/
   trunk/plugins/coclico/hudson/www/admin/index.php
Modified:
   trunk/plugins/coclico/Makefile
Log:
Preliminary autogenerated package


Modified: trunk/plugins/coclico/Makefile
===================================================================
--- trunk/plugins/coclico/Makefile	2010-04-29 14:58:47 UTC (rev 9650)
+++ trunk/plugins/coclico/Makefile	2010-04-29 15:20:03 UTC (rev 9651)
@@ -5,6 +5,7 @@
 
 PKGDIR1=mailman
 PKGDIR2=forumml
+PKGDIR3=hudson
 PKGDIR=mailman
 
 MINOR=$(shell head -1 $(PKGDIR)/debian/changelog | sed 's/.*(.*-\([^-]*\)).*/\1/')
@@ -13,7 +14,7 @@
 
 def:
 	@echo "#==============================================#"
-	@echo "Use make PKGDIR=<$(PKGDIR1)|$(PKGDIR2)> <target>"	
+	@echo "Use make PKGDIR=<$(PKGDIR1)|$(PKGDIR2)|$(PKGDIR3)> <target>"	
 	@#make -f Makefile.$(DIST) $(PARAM) default
 	@echo "target=default displays all params"
 	@echo "other available targets are: "

Added: trunk/plugins/coclico/hudson/bin/db-delete.pl
===================================================================
--- trunk/plugins/coclico/hudson/bin/db-delete.pl	                        (rev 0)
+++ trunk/plugins/coclico/hudson/bin/db-delete.pl	2010-04-29 15:20:03 UTC (rev 9651)
@@ -0,0 +1,187 @@
+#!/usr/bin/perl -w
+#
+# Debian-specific script to delete plugin-specific tables
+# Roland Mas <lolando at debian.org>
+
+use strict ;
+use diagnostics ;
+
+use DBI ;
+use MIME::Base64 ;
+use HTML::Entities ;
+
+use vars qw/$dbh @reqlist $query/ ;
+use vars qw/$sys_default_domain $sys_cvs_host $sys_download_host
+    $sys_shell_host $sys_users_host $sys_docs_host $sys_lists_host
+    $sys_dns1_host $sys_dns2_host $FTPINCOMING_DIR $FTPFILES_DIR
+    $sys_urlroot $sf_cache_dir $sys_name $sys_themeroot
+    $sys_news_group $sys_dbhost $sys_dbname $sys_dbuser $sys_dbpasswd
+    $sys_ldap_base_dn $sys_ldap_host $admin_login $admin_password
+    $server_admin $domain_name $newsadmin_groupid $statsadmin_groupid
+    $skill_list/ ;
+use vars qw/$pluginname/ ;
+
+sub is_lesser ( $$ ) ;
+sub is_greater ( $$ ) ;
+sub debug ( $ ) ;
+sub parse_sql_file ( $ ) ;
+
+require ("/usr/share/gforge/lib/include.pl") ; # Include a few predefined functions 
+require ("/usr/share/gforge/lib/sqlparser.pm") ; # Our magic SQL parser
+
+debug "You'll see some debugging info during this installation." ;
+debug "Do not worry unless told otherwise." ;
+
+&db_connect ;
+
+# debug "Connected to the database OK." ;
+
+$pluginname = "hudson" ;
+
+$dbh->{AutoCommit} = 0;
+$dbh->{RaiseError} = 1;
+eval {
+    my ($sth, @array, $version, $action, $path, $target, $rname) ;
+
+    my $pattern = "plugin_" . $pluginname . '_%' ;
+
+    $query = "SELECT relname FROM pg_class WHERE relname LIKE '$pattern' AND relkind='v'" ;
+    $sth = $dbh->prepare ($query) ;
+    $sth->execute () ;
+    while (@array = $sth->fetchrow_array ()) {
+	$rname = $array [0] ;
+	&drop_view_if_exists ($rname) ;
+    }
+    $sth->finish () ;
+
+    $query = "SELECT relname FROM pg_class WHERE relname LIKE '$pattern' AND relkind='r'" ;
+    $sth = $dbh->prepare ($query) ;
+    $sth->execute () ;
+    while (@array = $sth->fetchrow_array ()) {
+	$rname = $array [0] ;
+	&drop_table_if_exists ($rname) ;
+    }
+    $sth->finish () ;
+
+    $query = "SELECT relname FROM pg_class WHERE relname LIKE '$pattern' AND relkind='i'" ;
+    $sth = $dbh->prepare ($query) ;
+    $sth->execute () ;
+    while (@array = $sth->fetchrow_array ()) {
+	$rname = $array [0] ;
+	&drop_index_if_exists ($rname) ;
+    }
+    $sth->finish () ;
+
+    $query = "SELECT relname FROM pg_class WHERE relname LIKE '$pattern' AND relkind='s'" ;
+    $sth = $dbh->prepare ($query) ;
+    $sth->execute () ;
+    while (@array = $sth->fetchrow_array ()) {
+	$rname = $array [0] ;
+	&drop_sequence_if_exists ($rname) ;
+    }
+    $sth->finish () ;
+
+    $dbh->commit ();
+
+
+    debug "It seems your database deletion went well and smoothly.  That's cool." ;
+    debug "Please enjoy using Debian FusionForge." ;
+
+    # There should be a commit at the end of every block above.
+    # If there is not, then it might be symptomatic of a problem.
+    # For safety, we roll back.
+    $dbh->rollback ();
+};
+
+if ($@) {
+    warn "Transaction aborted because $@" ;
+    debug "Transaction aborted because $@" ;
+    debug "Last SQL query was:\n$query\n(end of query)" ;
+    $dbh->rollback ;
+    debug "Please report this bug on the Debian bug-tracking system." ;
+    debug "Please include the previous messages as well to help debugging." ;
+    debug "You should not worry too much about this," ;
+    debug "your DB is still in a consistent state and should be usable." ;
+    exit 1 ;
+}
+
+$dbh->rollback ;
+$dbh->disconnect ;
+
+sub debug ( $ ) {
+    my $v = shift ;
+    chomp $v ;
+    print STDERR "$v\n" ;
+}
+
+sub drop_table_if_exists ( $ ) {
+    my $tname = shift or die  "Not enough arguments" ;
+    $query = "SELECT count(*) FROM pg_class WHERE relname='$tname' AND relkind='r'" ;
+    my $sth = $dbh->prepare ($query) ;
+    $sth->execute () ;
+    my @array = $sth->fetchrow_array () ;
+    $sth->finish () ;
+
+    if ($array [0] != 0) {
+	# debug "Dropping table $tname" ;
+	$query = "DROP TABLE $tname" ;
+	# debug $query ;
+	$sth = $dbh->prepare ($query) ;
+	$sth->execute () ;
+	$sth->finish () ;
+    }
+}
+
+sub drop_sequence_if_exists ( $ ) {
+    my $sname = shift or die  "Not enough arguments" ;
+    $query = "SELECT count(*) FROM pg_class WHERE relname='$sname' AND relkind='S'" ;
+    my $sth = $dbh->prepare ($query) ;
+    $sth->execute () ;
+    my @array = $sth->fetchrow_array () ;
+    $sth->finish () ;
+
+    if ($array [0] != 0) {
+	# debug "Dropping sequence $sname" ;
+	$query = "DROP SEQUENCE $sname" ;
+	# debug $query ;
+	$sth = $dbh->prepare ($query) ;
+	$sth->execute () ;
+	$sth->finish () ;
+    }
+}
+
+sub drop_index_if_exists ( $ ) {
+    my $iname = shift or die  "Not enough arguments" ;
+    $query = "SELECT count(*) FROM pg_class WHERE relname='$iname' AND relkind='i'" ;
+    my $sth = $dbh->prepare ($query) ;
+    $sth->execute () ;
+    my @array = $sth->fetchrow_array () ;
+    $sth->finish () ;
+
+    if ($array [0] != 0) {
+	# debug "Dropping index $iname" ;
+	$query = "DROP INDEX $iname" ;
+	# debug $query ;
+	$sth = $dbh->prepare ($query) ;
+	$sth->execute () ;
+	$sth->finish () ;
+    }
+}
+
+sub drop_view_if_exists ( $ ) {
+    my $iname = shift or die  "Not enough arguments" ;
+    $query = "SELECT count(*) FROM pg_class WHERE relname='$iname' AND relkind='v'" ;
+    my $sth = $dbh->prepare ($query) ;
+    $sth->execute () ;
+    my @array = $sth->fetchrow_array () ;
+    $sth->finish () ;
+
+    if ($array [0] != 0) {
+	# debug "Dropping view $iname" ;
+	$query = "DROP VIEW $iname" ;
+	# debug $query ;
+	$sth = $dbh->prepare ($query) ;
+	$sth->execute () ;
+	$sth->finish () ;
+    }
+}

Added: trunk/plugins/coclico/hudson/bin/db-upgrade.pl
===================================================================
--- trunk/plugins/coclico/hudson/bin/db-upgrade.pl	                        (rev 0)
+++ trunk/plugins/coclico/hudson/bin/db-upgrade.pl	2010-04-29 15:20:03 UTC (rev 9651)
@@ -0,0 +1,301 @@
+#!/usr/bin/perl -w
+#
+# Debian-specific script to upgrade the database between releases
+# Roland Mas <lolando at debian.org>
+
+use strict ;
+use diagnostics ;
+
+use DBI ;
+use MIME::Base64 ;
+use HTML::Entities ;
+
+use vars qw/$dbh @reqlist $query/ ;
+use vars qw/$sys_default_domain $sys_cvs_host $sys_download_host
+    $sys_shell_host $sys_users_host $sys_docs_host $sys_lists_host
+    $sys_dns1_host $sys_dns2_host $FTPINCOMING_DIR $FTPFILES_DIR
+    $sys_urlroot $sf_cache_dir $sys_name $sys_themeroot
+    $sys_news_group $sys_dbhost $sys_dbname $sys_dbuser $sys_dbpasswd
+    $sys_ldap_base_dn $sys_ldap_host $admin_login $admin_password
+    $server_admin $domain_name $newsadmin_groupid $statsadmin_groupid
+    $skill_list/ ;
+use vars qw/$pluginname/ ;
+
+sub is_lesser ( $$ ) ;
+sub is_greater ( $$ ) ;
+sub debug ( $ ) ;
+sub parse_sql_file ( $ ) ;
+
+require ("/usr/share/gforge/lib/include.pl") ; # Include a few predefined functions 
+require ("/usr/share/gforge/lib/sqlparser.pm") ; # Our magic SQL parser
+
+debug "You'll see some debugging info during this installation." ;
+debug "Do not worry unless told otherwise." ;
+
+&db_connect ;
+
+# debug "Connected to the database OK." ;
+
+$pluginname = "hudson" ;
+
+$dbh->{AutoCommit} = 0;
+$dbh->{RaiseError} = 1;
+eval {
+    my ($sth, @array, $version, $path, $target) ;
+
+    &create_metadata_table ("0") ;
+    
+    $version = &get_db_version ;
+    $target = "0.1" ;
+    if (is_lesser $version, $target) {
+	my @filelist = ( "/usr/share/gforge/plugins/$pluginname/db/$pluginname-init.sql" ) ;
+	
+	foreach my $file (@filelist) {
+	    debug "Processing $file" ;
+	    @reqlist = @{ &parse_sql_file ($file) } ;
+	    
+	    foreach my $s (@reqlist) {
+		$query = $s ;
+		# debug $query ;
+		$sth = $dbh->prepare ($query) ;
+		$sth->execute () ;
+		$sth->finish () ;
+	    }
+	}
+	@reqlist = () ;
+	
+	&update_db_version ($target) ;
+	debug "Committing." ;
+	$dbh->commit () ;
+    }
+    
+#    $version = &get_db_version ;
+#    $target = "0.2" ;
+#    if (is_lesser $version, $target) {
+#	debug "Adding local data." ;
+#	
+#	do "/etc/gforge/local.pl" or die "Cannot read /etc/gforge/local.pl" ;
+#	
+#	my $ip_address = qx/host $domain_name | awk '{print \}'/ ;
+#	
+#	@reqlist = (
+#		    "INSERT INTO plugin_".$pluginname."_sample_data (domain, ip_address) VALUES ('$domain_name', '$ip_address')",
+#		    ) ;
+#	
+#	foreach my $s (@reqlist) {
+#	    $query = $s ;
+#	    # debug $query ;
+#	    $sth = $dbh->prepare ($query) ;
+#	    $sth->execute () ;
+#	    $sth->finish () ;
+#	}
+#	@reqlist = () ;
+#	
+#	&update_db_version ($target) ;
+#	debug "Committing." ;
+#	$dbh->commit () ;
+#    }
+
+    debug "It seems your database install/upgrade went well and smoothly.  That's cool." ;
+    debug "Please enjoy using Debian FusionForge." ;
+
+    # There should be a commit at the end of every block above.
+    # If there is not, then it might be symptomatic of a problem.
+    # For safety, we roll back.
+    $dbh->rollback ();
+};
+
+if ($@) {
+    warn "Transaction aborted because $@" ;
+    debug "Transaction aborted because $@" ;
+    debug "Last SQL query was:\n$query\n(end of query)" ;
+    $dbh->rollback ;
+    debug "Please report this bug on the Debian bug-tracking system." ;
+    debug "Please include the previous messages as well to help debugging." ;
+    debug "You should not worry too much about this," ;
+    debug "your DB is still in a consistent state and should be usable." ;
+    exit 1 ;
+}
+
+$dbh->rollback ;
+$dbh->disconnect ;
+
+sub is_lesser ( $$ ) {
+    my $v1 = shift || 0 ;
+    my $v2 = shift || 0 ;
+
+    my $rc = system "dpkg --compare-versions $v1 lt $v2" ;
+
+    return (! $rc) ;
+}
+
+sub is_greater ( $$ ) {
+    my $v1 = shift || 0 ;
+    my $v2 = shift || 0 ;
+
+    my $rc = system "dpkg --compare-versions $v1 gt $v2" ;
+
+    return (! $rc) ;
+}
+
+sub debug ( $ ) {
+    my $v = shift ;
+    chomp $v ;
+    print STDERR "$v\n" ;
+}
+
+sub create_metadata_table ( $ ) {
+    my $v = shift || "0" ;
+    my $tablename = "plugin_" .$pluginname . "_meta_data" ;
+    # Do we have the metadata table?
+
+    $query = "SELECT count(*) FROM pg_class WHERE relname = '$tablename' and relkind = 'r'";
+    # debug $query ;
+    my $sth = $dbh->prepare ($query) ;
+    $sth->execute () ;
+    my @array = $sth->fetchrow_array () ;
+    $sth->finish () ;
+
+    # Let's create this table if we have it not
+
+    if ($array [0] == 0) {
+	debug "Creating $tablename table." ;
+	$query = "CREATE TABLE $tablename (key varchar primary key, value text not null)" ;
+	# debug $query ;
+	$sth = $dbh->prepare ($query) ;
+	$sth->execute () ;
+	$sth->finish () ;
+    }
+
+    $query = "SELECT count(*) FROM $tablename WHERE key = 'db-version'";
+    # debug $query ;
+    $sth = $dbh->prepare ($query) ;
+    $sth->execute () ;
+    @array = $sth->fetchrow_array () ;
+    $sth->finish () ;
+
+    # Empty table?  We'll have to fill it up a bit
+
+    if ($array [0] == 0) {
+	debug "Inserting first data into $tablename table." ;
+	$query = "INSERT INTO $tablename (key, value) VALUES ('db-version', '$v')" ;
+	# debug $query ;
+	$sth = $dbh->prepare ($query) ;
+	$sth->execute () ;
+	$sth->finish () ;
+    }
+}
+
+sub update_db_version ( $ ) {
+    my $v = shift or die "Not enough arguments" ;
+    my $tablename = "plugin_" .$pluginname . "_meta_data" ;
+
+    debug "Updating $tablename table." ;
+    $query = "UPDATE $tablename SET value = '$v' WHERE key = 'db-version'" ;
+    # debug $query ;
+    my $sth = $dbh->prepare ($query) ;
+    $sth->execute () ;
+    $sth->finish () ;
+}
+
+sub get_db_version () {
+    my $tablename = "plugin_" .$pluginname . "_meta_data" ;
+
+    $query = "SELECT value FROM $tablename WHERE key = 'db-version'" ;
+    # debug $query ;
+    my $sth = $dbh->prepare ($query) ;
+    $sth->execute () ;
+    my @array = $sth->fetchrow_array () ;
+    $sth->finish () ;
+
+    my $version = $array [0] ;
+
+    return $version ;
+}
+
+sub drop_table_if_exists ( $ ) {
+    my $tname = shift or die  "Not enough arguments" ;
+    $query = "SELECT count(*) FROM pg_class WHERE relname='$tname' AND relkind='r'" ;
+    my $sth = $dbh->prepare ($query) ;
+    $sth->execute () ;
+    my @array = $sth->fetchrow_array () ;
+    $sth->finish () ;
+
+    if ($array [0] != 0) {
+	# debug "Dropping table $tname" ;
+	$query = "DROP TABLE $tname" ;
+	# debug $query ;
+	$sth = $dbh->prepare ($query) ;
+	$sth->execute () ;
+	$sth->finish () ;
+    }
+}
+
+sub drop_sequence_if_exists ( $ ) {
+    my $sname = shift or die  "Not enough arguments" ;
+    $query = "SELECT count(*) FROM pg_class WHERE relname='$sname' AND relkind='S'" ;
+    my $sth = $dbh->prepare ($query) ;
+    $sth->execute () ;
+    my @array = $sth->fetchrow_array () ;
+    $sth->finish () ;
+
+    if ($array [0] != 0) {
+	# debug "Dropping sequence $sname" ;
+	$query = "DROP SEQUENCE $sname" ;
+	# debug $query ;
+	$sth = $dbh->prepare ($query) ;
+	$sth->execute () ;
+	$sth->finish () ;
+    }
+}
+
+sub drop_index_if_exists ( $ ) {
+    my $iname = shift or die  "Not enough arguments" ;
+    $query = "SELECT count(*) FROM pg_class WHERE relname='$iname' AND relkind='i'" ;
+    my $sth = $dbh->prepare ($query) ;
+    $sth->execute () ;
+    my @array = $sth->fetchrow_array () ;
+    $sth->finish () ;
+
+    if ($array [0] != 0) {
+	# debug "Dropping index $iname" ;
+	$query = "DROP INDEX $iname" ;
+	# debug $query ;
+	$sth = $dbh->prepare ($query) ;
+	$sth->execute () ;
+	$sth->finish () ;
+    }
+}
+
+sub drop_view_if_exists ( $ ) {
+    my $iname = shift or die  "Not enough arguments" ;
+    $query = "SELECT count(*) FROM pg_class WHERE relname='$iname' AND relkind='v'" ;
+    my $sth = $dbh->prepare ($query) ;
+    $sth->execute () ;
+    my @array = $sth->fetchrow_array () ;
+    $sth->finish () ;
+
+    if ($array [0] != 0) {
+	# debug "Dropping view $iname" ;
+	$query = "DROP VIEW $iname" ;
+	# debug $query ;
+	$sth = $dbh->prepare ($query) ;
+	$sth->execute () ;
+	$sth->finish () ;
+    }
+}
+
+sub bump_sequence_to ( $$ ) {
+    my ($sth, @array, $seqname, $targetvalue) ;
+
+    $seqname = shift ;
+    $targetvalue = shift ;
+
+    do {
+	$query = "select nextval ('$seqname')" ;
+	$sth = $dbh->prepare ($query) ;
+	$sth->execute () ;
+	@array = $sth->fetchrow_array () ;
+	$sth->finish () ;
+    } until $array[0] >= $targetvalue ;
+}

Added: trunk/plugins/coclico/hudson/bin/sayhello
===================================================================
--- trunk/plugins/coclico/hudson/bin/sayhello	                        (rev 0)
+++ trunk/plugins/coclico/hudson/bin/sayhello	2010-04-29 15:20:03 UTC (rev 9651)
@@ -0,0 +1,9 @@
+#! /usr/bin/perl -w
+
+my $world ;
+
+do "/etc/gforge/plugins/hudson/world.conf"
+    or die "Cannot read /etc/gforge/plugins/hudson/world.conf" ;
+
+print STDOUT "Hello $world on STDOUT!\n" ;
+print STDERR "Hello $world on STDERR!\n" ;

Added: trunk/plugins/coclico/hudson/cronjobs/manage_hudson.php
===================================================================
--- trunk/plugins/coclico/hudson/cronjobs/manage_hudson.php	                        (rev 0)
+++ trunk/plugins/coclico/hudson/cronjobs/manage_hudson.php	2010-04-29 15:20:03 UTC (rev 9651)
@@ -0,0 +1,70 @@
+#! /usr/bin/php5 -f
+<?php
+/**
+ * FusionForge source control management
+ *
+ * Copyright 2009, Roland Mas
+ *
+ * This file is part of FusionForge.
+ *
+ * FusionForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2 of the License,
+ * or (at your option) any later version.
+ * 
+ * FusionForge is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with FusionForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ * USA
+ */
+require 'env.inc.php';
+require_once $gfwww.'include/squal_pre.php';
+require_once $gfcommon.'include/cron_utils.php';
+
+// MailingList backend class
+/* This is only sample
+require_once $gfplugins.'hudson/include/BackendHelloworld.class.php' ;
+			 
+
+$res = db_query_params ('SELECT id,type, parameters FROM system_event WHERE status=$1 ORDER BY id DESC',
+			array ('1')); 
+if (!$res) {
+	printf('Unable to get list of events: '.db_error());
+	return false;
+}
+
+while ($data = db_fetch_array ($res)) {
+	if($data['type'] == 'HELLOWORLD_CREATE') {
+		$result = BackendHelloworld::instance()->createList($data['parameters']);
+	} elseif ($data['type'] == 'HELLOWORLD_DELETE') {
+		$result = BackendHelloworld::instance()->deleteList($data['parameters']);
+	}
+	$result ? $log="DONE":$test="ERROR";
+	$events[$data['id']]=$log;
+	echo "\n Event ".$data['id']." : ".$data['type']." ".$log." for list id=".$data['parameters'];
+}
+if(isset($events)) {
+	foreach($events as $event_id => $log) {
+		$sql = "UPDATE system_event SET end_date=$1, log=$2, status='3' WHERE id=$3;"; 
+		$result = db_query_params($sql,array(time(),$log,$event_id));
+		if (!$result) {
+			printf('Unable to update the list of events: '.db_error());
+			return false;
+		}
+	}
+
+}
+*/
+
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
+?>

Added: trunk/plugins/coclico/hudson/debian/README.Debian
===================================================================
--- trunk/plugins/coclico/hudson/debian/README.Debian	                        (rev 0)
+++ trunk/plugins/coclico/hudson/debian/README.Debian	2010-04-29 15:20:03 UTC (rev 9651)
@@ -0,0 +1,6 @@
+fusionforge-plugin-hudson for Debian
+---------------------
+
+See README.Debian in fusionforge-common package
+
+ -- Christian Bayle <bayle at debian.org>  Mon, 08 Mar 2010 16:37:51 +0100

Added: trunk/plugins/coclico/hudson/debian/README.source
===================================================================
--- trunk/plugins/coclico/hudson/debian/README.source	                        (rev 0)
+++ trunk/plugins/coclico/hudson/debian/README.source	2010-04-29 15:20:03 UTC (rev 9651)
@@ -0,0 +1,9 @@
+hudson for Debian
+---------------------
+
+<this file describes information about the source package, see Debian policy
+manual section 4.14. You WILL either need to modify or delete this file>
+
+
+
+

Added: trunk/plugins/coclico/hudson/debian/changelog
===================================================================
--- trunk/plugins/coclico/hudson/debian/changelog	                        (rev 0)
+++ trunk/plugins/coclico/hudson/debian/changelog	2010-04-29 15:20:03 UTC (rev 9651)
@@ -0,0 +1,5 @@
+fusionforge-plugin-hudson (1.0-1) unstable; urgency=low
+
+  * Initial release (Closes: #nnnn)  <nnnn is the bug number of your ITP>
+
+ -- Christian Bayle <bayle at debian.org>  Mon, 08 Mar 2010 16:37:51 +0100

Added: trunk/plugins/coclico/hudson/debian/compat
===================================================================
--- trunk/plugins/coclico/hudson/debian/compat	                        (rev 0)
+++ trunk/plugins/coclico/hudson/debian/compat	2010-04-29 15:20:03 UTC (rev 9651)
@@ -0,0 +1 @@
+7

Added: trunk/plugins/coclico/hudson/debian/control
===================================================================
--- trunk/plugins/coclico/hudson/debian/control	                        (rev 0)
+++ trunk/plugins/coclico/hudson/debian/control	2010-04-29 15:20:03 UTC (rev 9651)
@@ -0,0 +1,20 @@
+Source: fusionforge-plugin-hudson
+Section: devel
+Priority: optional
+Maintainer: Christian Bayle <bayle at debian.org>
+Uploaders: Roland Mas <lolando at debian.org>
+Build-Depends-Indep: devscripts
+Build-Depends: debhelper (>= 7), perl, gettext
+Standards-Version: 3.8.4
+Homepage: http://fusionforge.org/
+Vcs-Bzr: http://scm.fusionforge.org/bzr/fusionforge/svn-trunk-ro/
+
+Package: fusionforge-plugin-hudson
+Architecture: all
+Depends: gforge-common, gforge-db-postgresql | gforge-db, gforge-web-apache2 | gforge-web, gforge-shell-postgresql | gforge-shell, php5-cli, ${misc:Depends}
+Description: collaborative development tool - Hudson plugin
+ .
+ This plugin contains the Hudson subsystem of FusionForge. It allows each
+ FusionForge project to have its own Hudson, and gives some
+ control over it to the project's administrator.
+

Added: trunk/plugins/coclico/hudson/debian/copyright
===================================================================
--- trunk/plugins/coclico/hudson/debian/copyright	                        (rev 0)
+++ trunk/plugins/coclico/hudson/debian/copyright	2010-04-29 15:20:03 UTC (rev 9651)
@@ -0,0 +1,63 @@
+The "sourceforge" package was first debianised on Wed, 22 Nov 2000
+22:06:35 +0100 by Roland Mas <lolando at debian.org>.  Work has been
+constant since then, and the package evolved a great deal.  It began
+to work, for a start, and then it evolved into GForge, what with the
+more recent versions of the Sourceforge software having been made
+proprietary.  And then in early 2009 it evolved into FusionForge, what
+with the more recent versions of GForge having been rewritten as
+proprietary software without a name change.
+
+FusionForge is Copyright © 2009-2010 by several people, including:
+Alain Peyrat            <aljeux at free.fr>
+Alexandre Neymann       <alexandre.neymann at dgfip.finances.gouv.fr>
+Christian Bayle         <bayle at debian.org>
+Roland Mas              <lolando at debian.org>
+Gonéri Le Bouder        <goneri.lebouder at atosorigin.com>
+Julien Heyman 		<julien.heyman at atosorigin.com>
+Olivier Meunier 	<olivier.meunier at centraliens.net>
+
+GForge itself is Copyright © 2000-2008 by a fair number of people,
+including:
+Tim Perdue              <tim at gforge.org>
+Roland Mas              <99.roland.mas at aist.enst.fr>
+Christian Bayle         <gforge at free.fr>
+Tom Copeland            <tom at infoether.com>
+Guillaume Smet          <guillaume-gforge at smet.org>
+Francisco Gimeno        <kikov at kikov.org>
+Sung Kim                <hunkims at gmail.com>
+Alain Peyrat            <aljeux at free.fr>
+
+Past Members of the development team include:
+Reinhard Spisser
+Ryan T. Sammartino
+Edward Ritter
+Michael Jennings
+
+Since FusionForge, and GForge before it, was initially a fork of
+Sourceforge, here's the copyright info for the Sourceforge software:
+,----
+| The original sources were downloaded from http://www.sourceforge.net/
+| 
+| Authors: The Sourceforge crew at VA Linux.  They are many, they
+| change as time goes by, and they are listed on the Sourceforge
+| website.  Let them be thanked for their work.
+| 
+| Copyright:
+| 
+| This software is Copyright © 1999-2000 by VA Linux.
+| 
+| You are free to distribute this software under the terms of the GNU
+| General Public License.
+`----
+
+The packaging and installing scripts (in the debian/ and deb-specific/
+directories amongst others) are Copyright © 2000-2010 by Christian
+Bayle <bayle at aist.enst.fr> and Roland Mas <lolando at debian.org>.  You
+are free to use and redistribute them under the terms of the GNU
+General Public License, version 2 or (at your option) any later
+version published by the Free Software Foundation.
+
+See Also Copyright file in fusionforge package
+
+On Debian systems, the complete text of the GNU General Public License
+can be found in the /usr/share/common-licenses directory.

Added: trunk/plugins/coclico/hudson/debian/dsf-in/plugin-hudson.postinst
===================================================================
--- trunk/plugins/coclico/hudson/debian/dsf-in/plugin-hudson.postinst	                        (rev 0)
+++ trunk/plugins/coclico/hudson/debian/dsf-in/plugin-hudson.postinst	2010-04-29 15:20:03 UTC (rev 9651)
@@ -0,0 +1,51 @@
+#! /bin/sh
+# postinst script for @OLDPACKAGE at -plugin-hudson
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+#        * <old-postinst> `abort-upgrade' <new version>
+#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#          <new-version>
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+#
+# quoting from the policy:
+#     Any necessary prompting should almost always be confined to the
+#     post-installation script, and should be protected with a conditional
+#     so that unnecessary prompting doesn't happen if a package's
+#     installation fails and the `postinst' is called with `abort-upgrade',
+#     `abort-remove' or `abort-deconfigure'.
+
+case "$1" in
+    configure)
+	@OLDPACKAGE at -config
+
+	# Prepare database
+	su -s /bin/sh @OLDPACKAGE@ -c '/usr/share/@OLDPACKAGE@/bin/register-plugin hudson "Hudson"'
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
+

Added: trunk/plugins/coclico/hudson/debian/dsf-in/plugin-hudson.prerm
===================================================================
--- trunk/plugins/coclico/hudson/debian/dsf-in/plugin-hudson.prerm	                        (rev 0)
+++ trunk/plugins/coclico/hudson/debian/dsf-in/plugin-hudson.prerm	2010-04-29 15:20:03 UTC (rev 9651)
@@ -0,0 +1,45 @@
+#! /bin/sh
+# prerm script for @OLDPACKAGE at -plugin-hudson
+#
+# see: dh_installdeb(1)
+set -e
+
+#DEBHELPER#
+
+# summary of how this script can be called:
+#        * <prerm> `remove'
+#        * <old-prerm> `upgrade' <new-version>
+#        * <new-prerm> `failed-upgrade' <old-version>
+#        * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
+#        * <deconfigured's-prerm> `deconfigure' `in-favour'
+#          <package-being-installed> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    remove|deconfigure)
+	if [ -f /var/run/postgresql/.s.PGSQL.5432 ]
+	then
+		/usr/share/@OLDPACKAGE@/bin/unregister-plugin hudson
+	else
+		echo "WARNING: database not available to unregister Hudson plugin"
+	fi
+        ;;
+    upgrade|failed-upgrade)
+        ;;
+    *)
+        echo "prerm called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+
+
+exit 0
+
+

Added: trunk/plugins/coclico/hudson/debian/rules
===================================================================
--- trunk/plugins/coclico/hudson/debian/rules	                        (rev 0)
+++ trunk/plugins/coclico/hudson/debian/rules	2010-04-29 15:20:03 UTC (rev 9651)
@@ -0,0 +1,85 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+SRCPACKAGE=$(shell head -1 $(CURDIR)/debian/changelog | sed 's/\(.[^ ]*\) .*/\1/')
+MAJOR=$(shell head -1 $(CURDIR)/debian/changelog | sed 's/.*(\(.*\)-[^-]*).*/\1/')
+ORIGFILE=$(SRCPACKAGE)_$(MAJOR).orig.tar.gz
+OLDPACKAGE=gforge
+PACKAGE=fusionforge
+FORGENAME=FusionForge
+
+SED_REPLACE=sed -e 's/@PACKAGE@/$(PACKAGE)/g' -e 's/@SRCPACKAGE@/$(SRCPACKAGE)/g' -e 's/@FORGENAME@/$(FORGENAME)/g' -e 's/@OLDPACKAGE@/$(OLDPACKAGE)/g'
+
+CRONDFILES=$(patsubst packaging/cron.d/%,debian/$(PACKAGE)-%.cron.d,$(wildcard packaging/cron.d/[a-z]*))
+DIRSFILES=$(patsubst packaging/dirs/%,debian/$(PACKAGE)-%.dirs,$(wildcard packaging/dirs/[a-z]*))
+LINKSFILES=$(patsubst packaging/links/%,debian/$(PACKAGE)-%.links,$(wildcard packaging/links/[a-z]*))
+INSTALLFILES=$(patsubst packaging/install/%,debian/$(PACKAGE)-%.install,$(wildcard packaging/install/[a-z]*))
+DOCSFILES=$(patsubst packaging/docs/%,debian/$(PACKAGE)-%.docs,$(wildcard packaging/docs/[a-z]*))
+POFILES=$(patsubst debian/dsf-po/%,debian/po/%,$(wildcard debian/dsf-po/*) debian/po/POTFILES.in)
+DSFINFILES=$(patsubst debian/dsf-in/%,debian/$(PACKAGE)-%,$(wildcard debian/dsf-in/[a-z]*))
+
+.PHONY: conffiles
+conffiles: $(CRONDFILES) $(DIRSFILES) $(LINKSFILES) $(INSTALLFILES) $(DOCSFILES) $(DSFINFILES) debian/control
+
+debian/$(PACKAGE)-%.cron.d:
+	(cat $(CURDIR)/packaging/cron.d/00phpcron ; sed -e 's/\$$FFUSER/$(PACKAGE)/g' $(CURDIR)/packaging/cron.d/$*) > $@
+
+debian/$(PACKAGE)-%.dirs:
+	cp $(CURDIR)/packaging/dirs/$* $@ 
+
+debian/$(PACKAGE)-%.links:
+	cp $(CURDIR)/packaging/links/$* $@ 
+
+debian/$(PACKAGE)-%.install:
+	cp $(CURDIR)/packaging/install/$* $@ 
+
+debian/$(PACKAGE)-%.docs:
+	cp $(CURDIR)/packaging/docs/$* $@
+
+debian/control: $(wildcard packaging/control/*)
+	ls $(CURDIR)/packaging/control/[0-9][0-9][0-9]* | grep -v shortdesc | grep -v scmcpold | while read file ; do cat $${file}; if [ -f $${file}.shortdesc ] ; then cat $(CURDIR)/packaging/control/AAAdesc; echo ' .'; cat $${file}.shortdesc; fi; echo '';  done | $(SED_REPLACE) > $@
+
+debian/po/templates.pot: $(wildcard debian/dsf-in/*.templates.dsfh-in) $(wildcard debian/dsf-helper/*.templates)
+        @debconf-updatepo --podir=debian/dsf-po
+
+debian/po/%:
+	cat $(patsubst debian/po/%,debian/dsf-po/%,$@) | $(SED_REPLACE) > $@
+
+# postinst and prerm files
+debian/$(PACKAGE)-%:
+	cat $(patsubst debian/$(PACKAGE)-%,debian/dsf-in/%,$@) | $(SED_REPLACE) > $@
+
+build: debian/po/templates.pot conffiles
+	dh $@
+	# Build gettext *.mo files
+	utils/manage-translations.sh build
+
+clean:
+	dh $@
+	rm -f $(CURDIR)/debian/*.cron.d
+	rm -f $(CURDIR)/debian/*.dirs
+	rm -f $(CURDIR)/debian/*.links
+	rm -f $(CURDIR)/debian/*.install
+	rm -f $(CURDIR)/debian/*.docs
+	rm -f $(CURDIR)/debian/*.postinst
+	rm -f $(CURDIR)/debian/*.prerm
+	rm -rf locales
+	rm -f $(POFILES)
+
+makeorig: 
+	find $(PKGDIR) -type f -or -type l | grep -v '/CVS/' | \
+	grep -v '/.svn/' | grep -v '/.testbox/' | \
+	grep -v rpm-specific | grep -v docs/phpdoc/docs | \
+	grep -v ^./debian/ | grep -v \\.jar$$ | \
+	grep -v \\.pdf$$ | grep -v plugins/fckeditor/www/_samples | \
+	cpio -o -H ustar | gzip > ../$(ORIGFILE)
+
+%:
+	dh  $@

Added: trunk/plugins/coclico/hudson/debian/source/format
===================================================================
--- trunk/plugins/coclico/hudson/debian/source/format	                        (rev 0)
+++ trunk/plugins/coclico/hudson/debian/source/format	2010-04-29 15:20:03 UTC (rev 9651)
@@ -0,0 +1 @@
+1.0

Added: trunk/plugins/coclico/hudson/etc/httpd.d/62plugin-hudson
===================================================================
--- trunk/plugins/coclico/hudson/etc/httpd.d/62plugin-hudson	                        (rev 0)
+++ trunk/plugins/coclico/hudson/etc/httpd.d/62plugin-hudson	2010-04-29 15:20:03 UTC (rev 9651)
@@ -0,0 +1,12 @@
+# 62plugin-hudson begin
+#	AddHandler cgi-script .cgi
+
+#	ScriptAlias /cgi-bin/hudson/ /var/lib/hudson/cgi-bin/
+#	ScriptAlias /hudson/ /var/lib/hudson/cgi-bin/
+
+#	Alias /images/hudson /usr/share/images/hudson
+#	<Location /images/hudson>
+#		order allow,deny
+#		allow from all
+#	</Location>
+# 62plugin-hudson end

Added: trunk/plugins/coclico/hudson/etc/plugins/hudson/config.php
===================================================================
--- trunk/plugins/coclico/hudson/etc/plugins/hudson/config.php	                        (rev 0)
+++ trunk/plugins/coclico/hudson/etc/plugins/hudson/config.php	2010-04-29 15:20:03 UTC (rev 9651)
@@ -0,0 +1,7 @@
+<?php 
+
+// here you can put all your configuration variables
+
+$world = 'Earth';
+
+?>

Added: trunk/plugins/coclico/hudson/packaging/control/000source
===================================================================
--- trunk/plugins/coclico/hudson/packaging/control/000source	                        (rev 0)
+++ trunk/plugins/coclico/hudson/packaging/control/000source	2010-04-29 15:20:03 UTC (rev 9651)
@@ -0,0 +1,10 @@
+Source: @SRCPACKAGE@
+Section: devel
+Priority: optional
+Maintainer: Christian Bayle <bayle at debian.org>
+Uploaders: Roland Mas <lolando at debian.org>
+Build-Depends-Indep: devscripts
+Build-Depends: debhelper (>= 7), perl, gettext
+Standards-Version: 3.8.4
+Homepage: http://fusionforge.org/
+Vcs-Bzr: http://scm.fusionforge.org/bzr/fusionforge/svn-trunk-ro/

Added: trunk/plugins/coclico/hudson/packaging/control/222plugin-hudson
===================================================================
--- trunk/plugins/coclico/hudson/packaging/control/222plugin-hudson	                        (rev 0)
+++ trunk/plugins/coclico/hudson/packaging/control/222plugin-hudson	2010-04-29 15:20:03 UTC (rev 9651)
@@ -0,0 +1,4 @@
+Package: @SRCPACKAGE@
+Architecture: all
+Depends: @OLDPACKAGE at -common, @OLDPACKAGE at -db-postgresql | @OLDPACKAGE at -db, @OLDPACKAGE at -web-apache2 | @OLDPACKAGE at -web, @OLDPACKAGE at -shell-postgresql | @OLDPACKAGE at -shell, php5-cli, ${misc:Depends}
+Description: collaborative development tool - Hudson plugin

Added: trunk/plugins/coclico/hudson/packaging/control/222plugin-hudson.shortdesc
===================================================================
--- trunk/plugins/coclico/hudson/packaging/control/222plugin-hudson.shortdesc	                        (rev 0)
+++ trunk/plugins/coclico/hudson/packaging/control/222plugin-hudson.shortdesc	2010-04-29 15:20:03 UTC (rev 9651)
@@ -0,0 +1,3 @@
+ This plugin contains the Hudson subsystem of FusionForge. It allows each
+ FusionForge project to have its own Hudson, and gives some
+ control over it to the project's administrator.

Added: trunk/plugins/coclico/hudson/packaging/dirs/plugin-hudson
===================================================================
--- trunk/plugins/coclico/hudson/packaging/dirs/plugin-hudson	                        (rev 0)
+++ trunk/plugins/coclico/hudson/packaging/dirs/plugin-hudson	2010-04-29 15:20:03 UTC (rev 9651)
@@ -0,0 +1,5 @@
+etc/gforge/httpd.d
+etc/gforge/plugins/hudson
+usr/share/gforge/plugins/hudson/cgi-bin
+usr/share/gforge/plugins/hudson/common
+usr/share/gforge/plugins/hudson/www

Added: trunk/plugins/coclico/hudson/packaging/docs/plugin-hudson
===================================================================
--- trunk/plugins/coclico/hudson/packaging/docs/plugin-hudson	                        (rev 0)
+++ trunk/plugins/coclico/hudson/packaging/docs/plugin-hudson	2010-04-29 15:20:03 UTC (rev 9651)
@@ -0,0 +1 @@
+debian/README.Debian

Added: trunk/plugins/coclico/hudson/packaging/install/plugin-hudson
===================================================================
--- trunk/plugins/coclico/hudson/packaging/install/plugin-hudson	                        (rev 0)
+++ trunk/plugins/coclico/hudson/packaging/install/plugin-hudson	2010-04-29 15:20:03 UTC (rev 9651)
@@ -0,0 +1,8 @@
+common/*                  usr/share/gforge/plugins/hudson/common/
+include/*                 usr/share/gforge/plugins/hudson/include/
+db/*                      usr/share/gforge/plugins/hudson/db/
+bin/*                     usr/share/gforge/plugins/hudson/bin/
+www/*                     usr/share/gforge/plugins/hudson/www/
+cronjobs/*                usr/share/gforge/cronjobs
+etc/plugins/hudson/*     etc/gforge/plugins/hudson/
+etc/httpd.d/*             usr/share/gforge/etc/httpd.d/

Added: trunk/plugins/coclico/hudson/packaging/links/plugin-hudson
===================================================================
--- trunk/plugins/coclico/hudson/packaging/links/plugin-hudson	                        (rev 0)
+++ trunk/plugins/coclico/hudson/packaging/links/plugin-hudson	2010-04-29 15:20:03 UTC (rev 9651)
@@ -0,0 +1 @@
+/usr/share/gforge/plugins/hudson/www /usr/share/gforge/www/plugins/hudson

Added: trunk/plugins/coclico/hudson/utils/manage-translations.sh
===================================================================
--- trunk/plugins/coclico/hudson/utils/manage-translations.sh	                        (rev 0)
+++ trunk/plugins/coclico/hudson/utils/manage-translations.sh	2010-04-29 15:20:03 UTC (rev 9651)
@@ -0,0 +1,56 @@
+#! /bin/sh -e
+
+if [ -e gforge/translations/gforge.pot ] ; then        # We're in the parent dir
+    cd gforge
+elif [ -e translations/gforge.pot ] ; then             # probably in gforge/ (or a renamed gforge/)
+    cd . # do nothing, but shell syntax requires an instruction in a then-block
+elif [ -e ../gforge/translations/gforge.pot ] ; then   # in tools/ or tests/ or something
+    cd ../gforge
+elif [ -e ../translations/gforge.pot ] ; then          # In a subdir of gforge/
+    cd ..
+else
+    echo "Couldn't find translations directory..."
+    exit 1
+fi
+
+locales=$(ls translations/*.po \
+    | xargs -n1 -iFILE basename FILE .po \
+    | egrep '^[a-z][a-z](_[A-Z][A-Z]$)?' \
+    | sort)
+
+print_stats () {
+    for l in $(echo $locales | xargs -n 1 | sort) ; do
+	printf "* %5s: " $l
+	msgfmt --statistics -o /dev/null translations/$l.po
+    done
+}
+
+case $1 in
+    stats)
+	print_stats
+	;;
+    refresh)
+	rm translations/gforge.pot
+	
+	find -type f -\( -name \*.php -or -name users -or -name projects -\) \
+	    | grep -v -e {arch} -e svn-base \
+	    | grep -v ^./plugins/wiki \
+	    | LANG=C sort \
+	    | xargs xgettext -d gforge -o translations/gforge.pot -L PHP --from-code=iso-8859-1
+	    
+	for l in $locales ; do
+	    echo "Processing $l..."
+	    msgmerge -U translations/$l.po translations/gforge.pot
+	done
+	;;
+    build)
+	for l in $locales ; do
+	    mkdir -p locales/$l/LC_MESSAGES
+	    msgfmt -o locales/$l/LC_MESSAGES/gforge.mo translations/$l.po
+	done
+	;;
+    *)
+	echo "Unknown operation"
+	exit 1
+	;;
+esac


Property changes on: trunk/plugins/coclico/hudson/utils/manage-translations.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/plugins/coclico/hudson/www/admin/index.php
===================================================================
--- trunk/plugins/coclico/hudson/www/admin/index.php	                        (rev 0)
+++ trunk/plugins/coclico/hudson/www/admin/index.php	2010-04-29 15:20:03 UTC (rev 9651)
@@ -0,0 +1,113 @@
+<?php
+
+/*
+ * Hudson plugin
+ *
+ * Daniel Perez <danielperez.arg at gmail.com>
+ *
+ * This is an example to watch things in action. You can obviously modify things and logic as you see fit
+ */
+
+require_once('../../../env.inc.php');
+require_once $gfwww.'include/pre.php';
+require_once $gfconfig.'plugins/hudson/config.php';
+
+// the header that displays for the user portion of the plugin
+function hudson_Project_Header($params) {                                                                                                                                         
+	global $DOCUMENT_ROOT,$HTML,$id;
+	$params['toptab']='hudson'; 
+	$params['group']=$id;
+	/*                                                                                                                                                              
+		Show horizontal links                                                                                                                                   
+	*/                                                                                                                                                              
+	site_project_header($params);														
+}
+
+// the header that displays for the project portion of the plugin
+function hudson_User_Header($params) {
+	global $DOCUMENT_ROOT,$HTML,$user_id;
+	$params['toptab']='hudson'; 
+	$params['user']=$user_id;
+	/*                                                                                                                                                              
+	 Show horizontal links                                                                                                                                   
+	 */                                                                                                                                                              
+	site_user_header($params);    
+}
+
+
+	$user = session_get_user(); // get the session user
+
+	if (!$user || !is_object($user) || $user->isError() || !$user->isActive()) {
+		exit_error("Invalid User", "Cannot Process your request for this user.");
+	}
+
+	$type = getStringFromRequest('type');
+	$id = getStringFromRequest('id');
+	$pluginname = getStringFromRequest('pluginname');
+	
+	if (!$type) {
+		exit_error("Cannot Process your request","No TYPE specified"); // you can create items in Base.tab and customize this messages
+	} elseif (!$id) {
+		exit_error("Cannot Process your request","No ID specified");
+	} else {
+		if ($type == 'group') {
+			$group = group_get_object($id);
+			if ( !$group) {
+				exit_error("Invalid Project", "Inexistent Project");
+			}
+			if ( ! ($group->usesPlugin ( $pluginname )) ) {//check if the group has the Hudson plugin active
+				exit_error("Error", "First activate the $pluginname plugin through the Project's Admin Interface");			
+			}
+			$userperm = $group->getPermission($user);//we'll check if the user belongs to the group (optional)
+			if ( !$userperm->IsMember()) {
+				exit_error("Access Denied", "You are not a member of this project");
+			}
+			// other perms checks here...
+			hudson_Project_Header(array('title'=>$pluginname . ' Project Plugin!','pagename'=>"$pluginname",'sectionvals'=>array(group_getname($id))));    
+			// DO THE STUFF FOR THE PROJECT PART HERE
+			echo "We are in the Project Hudson plugin <br>";
+			echo "Greetings from planet " . $world; // $world comes from the config file in /etc
+		} elseif ($type == 'user') {
+			$realuser = user_get_object($id);// 
+			if (!($realuser) || !($realuser->usesPlugin($pluginname))) {
+				exit_error("Error", "First activate the User's $pluginname plugin through Account Manteinance Page");
+			}
+			if ( (!$user) || ($user->getID() != $id)) { // if someone else tried to access the private Hudson part of this user
+				exit_error("Access Denied", "You cannot access other user's personal $pluginname");
+			}
+			hudson_User_Header(array('title'=>'My '.$pluginname,'pagename'=>"$pluginname",'sectionvals'=>array($realuser->getUnixName())));    
+			// DO THE STUFF FOR THE USER PART HERE
+			echo "We are in the User Hudson plugin <br>";
+			echo "Greetings from planet " . $world; // $world comes from the config file in /etc
+		} elseif ($type == 'admin') {
+			$group = group_get_object($id);
+			if ( !$group) {
+				exit_error("Invalid Project", "Inexistent Project");
+			}
+			if ( ! ($group->usesPlugin ( $pluginname )) ) {//check if the group has the Hudson plugin active
+				exit_error("Error", "First activate the $pluginname plugin through the Project's Admin Interface");			
+			}
+			$userperm = $group->getPermission($user);//we'll check if the user belongs to the group
+			if ( !$userperm->IsMember()) {
+				exit_error("Access Denied", "You are not a member of this project");
+			}
+			//only project admin can access here
+			if ( $userperm->isAdmin() ) {
+				hudson_Project_Header(array('title'=>$pluginname . ' Project Plugin!','pagename'=>"$pluginname",'sectionvals'=>array(group_getname($id))));    
+				// DO THE STUFF FOR THE PROJECT ADMINISTRATION PART HERE
+				echo "We are in the Project Hudson plugin <font color=\"#ff0000\">ADMINISTRATION</font> <br>";
+				echo "Greetings from planet " . $world; // $world comes from the config file in /etc
+			} else {
+				exit_error("Access Denied", "You are not a project Admin");
+			}
+		}
+	}	 
+	
+	site_project_footer(array());
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
+?>




More information about the Fusionforge-commits mailing list