[Fusionforge-commits] r8022 - in trunk/gforge: debian packaging/dirs plugins/scmgit/common

Roland Mas lolando at libremir.placard.fr.eu.org
Thu Aug 27 15:46:29 CEST 2009


Author: lolando
Date: 2009-08-27 15:46:28 +0200 (Thu, 27 Aug 2009)
New Revision: 8022

Modified:
   trunk/gforge/debian/control
   trunk/gforge/debian/rules
   trunk/gforge/packaging/dirs/plugin-scmgit
   trunk/gforge/plugins/scmgit/common/GitPlugin.class.php
Log:
A few fixes to the Git plugin (trying to start gitweb integration)

Modified: trunk/gforge/debian/control
===================================================================
--- trunk/gforge/debian/control	2009-08-27 13:46:18 UTC (rev 8021)
+++ trunk/gforge/debian/control	2009-08-27 13:46:28 UTC (rev 8022)
@@ -246,7 +246,7 @@
 
 Package: gforge-plugin-scmgit
 Architecture: all
-Depends: gforge-common, gforge-db-postgresql | gforge-db, gforge-web-apache2 | gforge-web, gforge-shell-postgresql | gforge-shell, git-core, php5-cli, ${misc:Depends}
+Depends: gforge-common, gforge-db-postgresql | gforge-db, gforge-web-apache2 | gforge-web, gforge-shell-postgresql | gforge-shell, git-core, gitweb, php5-cli, ${misc:Depends}
 Description: collaborative development tool - Git plugin
  FusionForge provides many tools to aid collaboration in a
  development project, such as bug-tracking, task management,

Modified: trunk/gforge/debian/rules
===================================================================
--- trunk/gforge/debian/rules	2009-08-27 13:46:18 UTC (rev 8021)
+++ trunk/gforge/debian/rules	2009-08-27 13:46:28 UTC (rev 8022)
@@ -169,6 +169,10 @@
 	ln -s /usr/share/darcsweb $(CURDIR)/debian/$(PACKAGE)-plugin-scmdarcs/usr/share/gforge/plugins/scmdarcs/www/darcsweb
 	ln -s ../../plugins/scmdarcs/www $(CURDIR)/debian/$(PACKAGE)-plugin-scmdarcs/usr/share/gforge/www/plugins/
 
+	ln -s /usr/lib/cgi-bin/gitweb.cgi $(CURDIR)/debian/$(PACKAGE)-plugin-scmgit/usr/share/gforge/plugins/scmdarcs/cgi-bin/
+	ln -s /usr/share/gitweb $(CURDIR)/debian/$(PACKAGE)-plugin-scmgit/usr/share/gforge/plugins/scmdarcs/www/darcsweb
+	ln -s ../../plugins/scmgit/www $(CURDIR)/debian/$(PACKAGE)-plugin-scmgit/usr/share/gforge/www/plugins/
+
 	# Remove Snoopy class from binary packages (provided by libphp-snoopy)
 	for i in $(addprefix $(CURDIR)/debian/,$(shell dh_listpackages)) ; do find $$i -name Snoopy.class.php | xargs rm -rf ; done
 

Modified: trunk/gforge/packaging/dirs/plugin-scmgit
===================================================================
--- trunk/gforge/packaging/dirs/plugin-scmgit	2009-08-27 13:46:18 UTC (rev 8021)
+++ trunk/gforge/packaging/dirs/plugin-scmgit	2009-08-27 13:46:28 UTC (rev 8022)
@@ -1,4 +1,6 @@
 etc/gforge/httpd.d
 etc/gforge/plugins/scmgit
+usr/share/gforge/plugins/scmgit/cgi-bin
 usr/share/gforge/plugins/scmgit/common
+usr/share/gforge/plugins/scmgit/www
 var/lib/gforge/chroot/scmrepos/git

Modified: trunk/gforge/plugins/scmgit/common/GitPlugin.class.php
===================================================================
--- trunk/gforge/plugins/scmgit/common/GitPlugin.class.php	2009-08-27 13:46:18 UTC (rev 8021)
+++ trunk/gforge/plugins/scmgit/common/GitPlugin.class.php	2009-08-27 13:46:28 UTC (rev 8022)
@@ -58,7 +58,7 @@
 
 	function getInstructionsForRW ($project) {
 		$b = _('<p><b>Developer GIT Access via SSH</b></p><p>Only project developers can access the GIT tree via this method. SSH must be installed on your client machine. Substitute <i>developername</i> with the proper values. Enter your site password when prompted.</p>');
-		$b .= '<p><tt>git clone git+ssh://<i>'._('developername').'</i>@' . $project->getSCMBox() . ':'. $this->git_root .'/'. $project->getUnixName().'/ .</tt></p>' ;
+		$b .= '<p><tt>git clone git+ssh://<i>'._('developername').'</i>@' . $project->getSCMBox() . ':'. $this->git_root .'/'. $project->getUnixName().'</tt></p>' ;
 		return $b ;
 	}
 
@@ -158,12 +158,14 @@
 			return false;
 		}
 
-		$repo = $this->git_root . '/' . $project->getUnixName() ;
-		$unix_group = 'scm_' . $project->getUnixName() ;
+		$project_name = $project->getUnixName() ;
+		$repo = $this->git_root . '/' . $project_name ;
+		$unix_group = 'scm_' . $project_name ;
 
 		system ("mkdir -p $repo") ;
-		if (!is_dir ("$repo/.git")) {
-			system ("git init $repo") ;
+		if (!is_file ("$repo/HEAD") && !is_dir("$repo/objects") && !is_dir("$repo/refs")) {
+			system ("GIT_DIR=\"$repo\" git --bare init") ;
+			system ("echo \"Git repository for $project_name\" > $repo/description") ;
 		}
 
 		system ("chgrp -R $unix_group $repo") ;
@@ -214,6 +216,7 @@
 		
 		$group_name = $project->getUnixName() ;
 
+		$snapshot = $sys_scm_snapshots_path.'/'.$group_name.'-scm-latest.tar.gz';
 		$tarball = $sys_scm_tarballs_path.'/'.$group_name.'-scmroot.tar.gz';
 
 		if (! $project->usesPlugin ($this->name)) {
@@ -233,10 +236,17 @@
 			return false ;
 		}
 
+		$today = date ('Y-m-d') ;
 		$tmp = trim (`mktemp -d`) ;
 		if ($tmp == '') {
 			return false ;
 		}
+
+		system ("git archive --format=tar --prefix=$group_name-scm-$today/ HEAD | gzip > $tmp/snapshot.tar.gz");
+		chmod ("$tmp/snapshot.tar.gz", 0644) ;
+		copy ("$tmp/snapshot.tar.gz", $snapshot) ;
+		unlink ("$tmp/snapshot.tar.gz") ;
+
 		system ("tar czCf $toprepo $tmp/tarball.tar.gz " . $project->getUnixName()) ;
 		chmod ("$tmp/tarball.tar.gz", 0644) ;
 		copy ("$tmp/tarball.tar.gz", $tarball) ;




More information about the Fusionforge-commits mailing list