setup_plugin_manager () ;
-$res=db_query("SELECT group_id FROM groups WHERE status='A' AND use_scm=1");
+$res=db_query("SELECT group_id FROM groups WHERE status='A' AND use_scm=1 ORDER BY group_id");
if (!$res) {
$this->setError('Unable to get hosted project count: '.db_error());
return false;
gforge (4.7+scmbzr-1) experimental; urgency=low
- * New package: gforge-plugin-scmbzr.
+ * New package: gforge-plugin-scmbzr (not complete yet!).
- -- Roland Mas <lolando@debian.org> Wed, 04 Feb 2009 11:24:38 +0100
+ -- Roland Mas <lolando@debian.org> Wed, 04 Feb 2009 17:53:58 +0100
gforge (4.7-1) experimental; urgency=low
# Daily incremental backup to /backup
# we have to discuss this
#15 23 * * * root [ -x /usr/lib/gforge/bin/gforge-db-backup.sh ] && /usr/lib/gforge/bin/gforge-db-backup.sh > /dev/null 2>&1
+
+# Create SCM repositories
+0 * * * * root [ -x /usr/lib/gforge/bin/create_scm_repos.php ] && /usr/lib/gforge/bin/create_scm_repos.php > /dev/null 2>&1
case 'scm_stats':
$this->getStats ($params) ;
break;
+ case 'scm_createrepo':
+ $this->createOrUpdateRepo ($params) ;
+ break;
case 'scm_plugin':
$scm_plugins=& $params['scm_plugins'];
$scm_plugins[]=$this->name;
$repo = $this->bzr_root . '/' . $project->getUnixName() ;
$unix_group = 'scm_' . $project->getUnixName() ;
- $pipe = popen ("bzr info $repo", "r") ;
- $line = fgets ($pipe) ;
- fclose ($pipe) ;
+
+ $repo_exists = false ;
+ if (is_dir ($repo)) {
+ $pipe = popen ("bzr info $repo 2>/dev/null", "r") ;
+ $line = fgets ($pipe) ;
+ fclose ($pipe) ;
+
+ if (preg_match ("/^Shared repository/", $line) != 0) {
+ $repo_exists = true ;
+ }
+ }
- if (preg_match ("^Shared repository", $line) == 0) {
+ if (!$repo_exists) {
system ("bzr init-repo --no-trees $repo") ;
}
+
system ("chgrp -R $unix_group $repo") ;
if ($project->enableAnonSCM()) {
system ("chmod -R g+wXs,o+rX-w $repo") ;