[Fusionforge-commits] r7989 - in trunk/gforge: cronjobs plugins/scmcpold/common

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


Author: lolando
Date: 2009-08-27 15:40:42 +0200 (Thu, 27 Aug 2009)
New Revision: 7989

Removed:
   trunk/gforge/cronjobs/maintain-scm.php
Modified:
   trunk/gforge/cronjobs/create_scm_repos.php
   trunk/gforge/plugins/scmcpold/common/CpoldPlugin.class.php
Log:
Cronjob to create all repos

Modified: trunk/gforge/cronjobs/create_scm_repos.php
===================================================================
--- trunk/gforge/cronjobs/create_scm_repos.php	2009-08-27 13:40:30 UTC (rev 7988)
+++ trunk/gforge/cronjobs/create_scm_repos.php	2009-08-27 13:40:42 UTC (rev 7989)
@@ -36,11 +36,10 @@
 			 
 setup_plugin_manager () ;
 
-$res=db_query_params ('SELECT group_id FROM groups WHERE status=$1 AND use_scm=1 ORDER BY group_id',
-			array('A')) ;
-
+$res = db_query_params ('SELECT group_id FROM groups WHERE status=$1 AND use_scm=1 ORDER BY group_id DESC',
+			array ('A')); 
 if (!$res) {
-	$this->setError('Unable to get hosted project count: '.db_error());
+	$this->setError('Unable to get list of projects using SCM: '.db_error());
 	return false;
 }
 

Deleted: trunk/gforge/cronjobs/maintain-scm.php
===================================================================
--- trunk/gforge/cronjobs/maintain-scm.php	2009-08-27 13:40:30 UTC (rev 7988)
+++ trunk/gforge/cronjobs/maintain-scm.php	2009-08-27 13:40:42 UTC (rev 7989)
@@ -1,48 +0,0 @@
-#! /usr/bin/php5
-<?php
-/** SCM repositories maintenance task
- *
- * 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 (dirname(__FILE__).'/../www/env.inc.php');
-require ($gfwww.'include/squal_pre.php');
-require ($gfcommon.'include/cron_utils.php');
-
-$groupids = array () ;
-foreach ($scm_list as $pname) {
-	$plugin = &plugin_get_object ($pname) ;
-	$gids = $plugin->getGroups () ;
-	$groupids = array_merge ($groupids, $gids) ;
-}
-
-$groupids = array_reverse ($groupids) ; // To handle new repos first
-foreach ($groupids as $group_id) {
-	$params = array ('group_id' => $group_id) ;
-	plugin_hook ('scm_createrepo', $params) ;
-}
-
-// Local Variables:
-// mode: php
-// c-file-style: "bsd"
-// End:
-
-?>

Modified: trunk/gforge/plugins/scmcpold/common/CpoldPlugin.class.php
===================================================================
--- trunk/gforge/plugins/scmcpold/common/CpoldPlugin.class.php	2009-08-27 13:40:30 UTC (rev 7988)
+++ trunk/gforge/plugins/scmcpold/common/CpoldPlugin.class.php	2009-08-27 13:40:42 UTC (rev 7989)
@@ -84,6 +84,7 @@
 		$repo = $this->cpold_root . '/' . $project->getUnixName() ;
 		$unix_group = 'scm_' . $project->getUnixName() ;
 
+		system ("mkdir -p $repo") ;
 		system ("chgrp -R $unix_group $repo") ;
 		if ($project->enableAnonSCM()) {
 			system ("chmod -R g+wXs,o+rX-w $repo") ;




More information about the Fusionforge-commits mailing list