[Fusionforge-commits] FusionForge branch 6.0 updated. 92c7ac10d6961bb59bd59daf259552f622825c1c

Sylvain Beucler beuc-inria at fusionforge.org
Tue Mar 31 18:35:27 CEST 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, 6.0 has been updated
       via  92c7ac10d6961bb59bd59daf259552f622825c1c (commit)
      from  62a44b5c40a4880678315185038c2ca4b6f567a6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 92c7ac10d6961bb59bd59daf259552f622825c1c
Author: Sylvain Beucler <sylvain.beucler at inria.fr>
Date:   Tue Mar 31 18:34:18 2015 +0200

    reactivity: regen scmsvn-auth.inc on nss_usergroups changes, rather than when updating repos. Trigger a *lot* less SCM_REPO events accordingly.

diff --git a/src/common/include/RBAC.php b/src/common/include/RBAC.php
index 95ef9f5..1ec670c 100644
--- a/src/common/include/RBAC.php
+++ b/src/common/include/RBAC.php
@@ -229,9 +229,6 @@ abstract class BaseRole extends Error {
 			}
 		}
 
-		$systasksq = new SysTasksQ();
-		$systasksq->add(SYSTASK_CORE, 'SCM_REPO', $project->getID());
-
 		return true ;
 	}
 
@@ -265,9 +262,6 @@ abstract class BaseRole extends Error {
 		$hook_params['project'] =& $project;
 		plugin_hook ("role_unlink_project", $hook_params);
 
-		$systasksq = new SysTasksQ();
-		$systasksq->add(SYSTASK_CORE, 'SCM_REPO', $project->getID());
-
 		return true ;
 	}
 
@@ -887,11 +881,6 @@ abstract class BaseRole extends Error {
 			}
 		}
 
-		$systasksq = new SysTasksQ();
-		foreach ($this->getLinkedProjects() as $project) {
-			$systasksq->add(SYSTASK_CORE, 'SCM_REPO', $project->getID());
-		}
-
 		return true;
 	}
 
@@ -1101,11 +1090,6 @@ abstract class RoleExplicit extends BaseRole implements PFO_RoleExplicit {
 			}
 		}
 
-		$systasksq = new SysTasksQ();
-		foreach ($this->getLinkedProjects() as $project) {
-			$systasksq->add(SYSTASK_CORE, 'SCM_REPO', $project->getID());
-		}
-
 		return true;
 	}
 
@@ -1138,11 +1122,6 @@ abstract class RoleExplicit extends BaseRole implements PFO_RoleExplicit {
 			}
 		}
 
-		$systasksq = new SysTasksQ();
-		foreach ($this->getLinkedProjects() as $project) {
-			$systasksq->add(SYSTASK_CORE, 'SCM_REPO', $project->getID());
-		}
-
 		return true ;
 	}
 
diff --git a/src/common/include/SCMPlugin.class.php b/src/common/include/SCMPlugin.class.php
index eddf97a..ae113ab 100644
--- a/src/common/include/SCMPlugin.class.php
+++ b/src/common/include/SCMPlugin.class.php
@@ -91,6 +91,11 @@ abstract class SCMPlugin extends Plugin {
 				$this->updateRepositoryList($params);
 				break;
 			}
+			case 'scm_regen_apache_auth': {
+				session_set_admin();
+				$this->regenApacheAuth($params);
+				break;
+			}
 			case 'scm_generate_snapshots': { // Optional
 				session_set_admin();
 				$this->generateSnapshots($params);
diff --git a/src/common/include/cron_utils.php b/src/common/include/cron_utils.php
index 9bfecf0..5fc4911 100644
--- a/src/common/include/cron_utils.php
+++ b/src/common/include/cron_utils.php
@@ -142,6 +142,10 @@ function cron_regen_apache_auth() {
 	fclose($config_f);
 	chmod($config_fname.'.new', 0644);
 	rename($config_fname.'.new', $config_fname);
+
+	# Regen scmsvn-auth.inc
+	$hook_params = array() ;
+	plugin_hook_by_reference ('scm_regen_apache_auth', $hook_params) ;
 }
 
 // Local Variables:
diff --git a/src/plugins/scmsvn/common/SVNPlugin.class.php b/src/plugins/scmsvn/common/SVNPlugin.class.php
index e908a63..33f00c4 100644
--- a/src/plugins/scmsvn/common/SVNPlugin.class.php
+++ b/src/plugins/scmsvn/common/SVNPlugin.class.php
@@ -56,6 +56,7 @@ some control over it to the project's administrator.");
 		$this->svn_root_dav = '/svn';
 		$this->_addHook('scm_browser_page');
 		$this->_addHook('scm_update_repolist');
+		$this->_addHook('scm_regen_apache_auth');
 		$this->_addHook('scm_generate_snapshots');
 		$this->_addHook('scm_gather_stats');
 		$this->_addHook('activity');
@@ -317,6 +318,9 @@ some control over it to the project's administrator.");
 	}
 
 	function updateRepositoryList(&$params) {
+	}
+
+	function regenApacheAuth(&$params) {
 		# Enable /authscm/$user/svn URLs
 		$config_fname = forge_get_config('data_path').'/scmsvn-auth.inc';
 		$config_f = fopen($config_fname.'.new', 'w');
diff --git a/src/plugins/scmsvn/etc/httpd.conf.d/vhost-scm-macros-scmsvn.inc b/src/plugins/scmsvn/etc/httpd.conf.d/vhost-scm-macros-scmsvn.inc
index 74d19fd..2517c85 100644
--- a/src/plugins/scmsvn/etc/httpd.conf.d/vhost-scm-macros-scmsvn.inc
+++ b/src/plugins/scmsvn/etc/httpd.conf.d/vhost-scm-macros-scmsvn.inc
@@ -3,8 +3,7 @@
   DAV svn
   SVNParentPath ${FF__scmsvn__repos_path}
   # Note: ^ this need to be in the macro, doesn't work in a LocationMatch
-  # This is pretty annoying, because we could trigger a lot less SCM_REPO
-  # events if we didn't have to generate this plugin-specific config :/
+  # This is pretty annoying, because this requires a plugin-specific macro :/
   # <LocationMatch /authscm/[^/]+/svn>
   # -> Can't open file '/srv/svn/authscm/format'
 </Location>

-----------------------------------------------------------------------

Summary of changes:
 src/common/include/RBAC.php                        |   21 --------------------
 src/common/include/SCMPlugin.class.php             |    5 +++++
 src/common/include/cron_utils.php                  |    4 ++++
 src/plugins/scmsvn/common/SVNPlugin.class.php      |    4 ++++
 .../etc/httpd.conf.d/vhost-scm-macros-scmsvn.inc   |    3 +--
 5 files changed, 14 insertions(+), 23 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list