[Fusionforge-commits] r13710 - in trunk/src: common/include plugins/scmbzr/common plugins/scmcvs/common plugins/scmdarcs/common plugins/scmsvn/common

Roland Mas lolando at fusionforge.org
Thu Jul 7 17:52:37 CEST 2011


Author: lolando
Date: 2011-07-07 17:52:37 +0200 (Thu, 07 Jul 2011)
New Revision: 13710

Modified:
   trunk/src/common/include/utils.php
   trunk/src/plugins/scmbzr/common/BzrPlugin.class.php
   trunk/src/plugins/scmcvs/common/CVSPlugin.class.php
   trunk/src/plugins/scmdarcs/common/DarcsPlugin.class.php
   trunk/src/plugins/scmsvn/common/SVNPlugin.class.php
Log:
Fixed SCM snapshot/tarball generation

Modified: trunk/src/common/include/utils.php
===================================================================
--- trunk/src/common/include/utils.php	2011-07-07 15:41:28 UTC (rev 13709)
+++ trunk/src/common/include/utils.php	2011-07-07 15:52:37 UTC (rev 13710)
@@ -1421,15 +1421,15 @@
 
 function util_get_compressed_file_extension() {
 	$m = forge_get_config('compression_method');
-	if (preg_match ('/^gzip /', $m)) {
+	if (preg_match ('/^gzip\b/', $m)) {
 		return '.gz';
-	} elseif (preg_match ('/^bzip2 /', $m)) {
+	} elseif (preg_match ('/^bzip2\b/', $m)) {
 		return '.bzip2';
-	} elseif (preg_match ('/^lzma /', $m)) {
+	} elseif (preg_match ('/^lzma\b/', $m)) {
 		return '.lzma';
-	} elseif (preg_match ('/^xz /', $m)) {
+	} elseif (preg_match ('/^xz\b/', $m)) {
 		return '.xz';
-	} elseif (preg_match ('/^cat /', $m)) {
+	} elseif (preg_match ('/^cat\b/', $m)) {
 		return '';
 	} else {
 		return '.compressed';

Modified: trunk/src/plugins/scmbzr/common/BzrPlugin.class.php
===================================================================
--- trunk/src/plugins/scmbzr/common/BzrPlugin.class.php	2011-07-07 15:41:28 UTC (rev 13709)
+++ trunk/src/plugins/scmbzr/common/BzrPlugin.class.php	2011-07-07 15:52:37 UTC (rev 13710)
@@ -452,13 +452,6 @@
 		$today = date ('Y-m-d') ;
 		$branch = $this->findMainBranch ($project) ;
 		if ($branch != '') {
-			system ("cd $tmp ; svn checkout file://$repo/trunk $dir > /dev/null 2>&1") ;
-			system ("tar cCf $tmp - $dir |".forge_get_config('compression_method')."> snapshot") ;
-			chmod ("$tmp/snapshot", 0644) ;
-			copy ("$tmp/snapshot", $snapshot) ;
-			unlink ("$tmp/snapshot") ;
-			system ("rm -rf $tmp/$dir") ;
-
 			system ("bzr export --root=$group_name-scm-$today --format=tar - $repo/$bname |".forge_get_config('compression_method')."> $tmp/snapshot") ;
 			chmod ("$tmp/snapshot", 0644) ;
 			copy ("$tmp/snapshot", $snapshot) ;

Modified: trunk/src/plugins/scmcvs/common/CVSPlugin.class.php
===================================================================
--- trunk/src/plugins/scmcvs/common/CVSPlugin.class.php	2011-07-07 15:41:28 UTC (rev 13709)
+++ trunk/src/plugins/scmcvs/common/CVSPlugin.class.php	2011-07-07 15:52:37 UTC (rev 13710)
@@ -422,7 +422,7 @@
 		$dir = $project->getUnixName ()."-$today" ;
 		system ("mkdir -p $tmp/$dir") ;
 		system ("cd $tmp/$dir ; cvs -d $repo export -D now . > /dev/null 2>&1") ;
-		system ("tar cCf $tmp - $dir |".forge_get_config('compression_method')."> snapshot") ;
+		system ("tar cCf $tmp - $dir |".forge_get_config('compression_method')."> $tmp/snapshot") ;
 		chmod ("$tmp/snapshot", 0644) ;
 		copy ("$tmp/snapshot", $snapshot) ;
 		unlink ("$tmp/snapshot") ;

Modified: trunk/src/plugins/scmdarcs/common/DarcsPlugin.class.php
===================================================================
--- trunk/src/plugins/scmdarcs/common/DarcsPlugin.class.php	2011-07-07 15:41:28 UTC (rev 13709)
+++ trunk/src/plugins/scmdarcs/common/DarcsPlugin.class.php	2011-07-07 15:52:37 UTC (rev 13710)
@@ -402,7 +402,7 @@
 		$dir = $project->getUnixName ()."-$today" ;
 		system ("mkdir -p $tmp/$dir") ;
 		system ("cd $tmp ; darcs $repo $dir > /dev/null 2>&1") ;
-		system ("tar cCf $tmp - $dir |".forge_get_config('compression_method')."> snapshot") ;
+		system ("tar cCf $tmp - $dir |".forge_get_config('compression_method')."> $tmp/snapshot") ;
 		chmod ("$tmp/snapshot", 0644) ;
 		copy ("$tmp/snapshot", $snapshot) ;
 		unlink ("$tmp/snapshot") ;

Modified: trunk/src/plugins/scmsvn/common/SVNPlugin.class.php
===================================================================
--- trunk/src/plugins/scmsvn/common/SVNPlugin.class.php	2011-07-07 15:41:28 UTC (rev 13709)
+++ trunk/src/plugins/scmsvn/common/SVNPlugin.class.php	2011-07-07 15:52:37 UTC (rev 13710)
@@ -520,7 +520,7 @@
 		system ("svn ls file://$repo/trunk > /dev/null", $code) ;
 		if ($code == 0) {
 			system ("cd $tmp ; svn export file://$repo/trunk $dir > /dev/null 2>&1") ;
-			system ("tar cCf $tmp - $dir |".forge_get_config('compression_method')."> snapshot") ;
+			system ("tar cCf $tmp - $dir |".forge_get_config('compression_method')."> $tmp/snapshot") ;
 			chmod ("$tmp/snapshot", 0644) ;
 			copy ("$tmp/snapshot", $snapshot) ;
 			unlink ("$tmp/snapshot") ;




More information about the Fusionforge-commits mailing list