cvs: SVNROOT / commit-email.php pear_avail pre-commit run-conversion.php
[email protected] ("Gwynne Raskind") Mon, 06 Jul 2009 21:40:31 -0000
| Newsgroups | svn.migration |
|---|---|
| Message-ID | <cvsgwynne1246916431@cvsserver> |
gwynne Mon Jul 6 21:40:31 2009 UTC
Modified files:
/SVNROOT commit-email.php pear_avail pre-commit run-conversion.php
Log:
- fix phd commit email address
- match commits with PCRE instead of glob
- only use pear_avail for actual pear modules
- deny commits to /archived and */tags/*
- give contact e-mail for karma denial
- archive obsolete CVS modules instead of ignoring
- PECL is a top-level module instead of a subdir of php/
- fix mispelled function name
- No longer need a separate pear_avail entry for phd
gwynne-20090706214031.txt
(text/plain, 9.9 KB)
http://cvs.php.net/viewvc.cgi/SVNROOT/commit-email.php?r1=1.15&r2=1.16&diff_format=u
Index: SVNROOT/commit-email.php
diff -u SVNROOT/commit-email.php:1.15 SVNROOT/commit-email.php:1.16
--- SVNROOT/commit-email.php:1.15 Wed Jun 24 13:58:16 2009
+++ SVNROOT/commit-email.php Mon Jul 6 21:40:30 2009
@@ -7,7 +7,7 @@
// -----------------------------------------------------------------------------------------------------------------------------
// Constants
-$version = substr('$Revision: 1.15 $', strlen('$Revision: '), -2);
+$version = substr('$Revision: 1.16 $', strlen('$Revision: '), -2);
$smtp_server = '127.0.0.1';
$commit_email_list = array(
// FastCGI ISAPI
@@ -64,7 +64,7 @@
'|^phpdoc/tr|' => array('[email protected]'),
'|^phpdoc/tw|' => array('[email protected]'),
'|^phpdoc/zh|' => array('[email protected]'),
- '|^phd|' => array('[email protected]'),
+ '|^phd|' => array('[email protected]'),
'|^web/doc|' => array('[email protected]'),
'|^doc-editor|' => array('[email protected]'),
@@ -77,7 +77,7 @@
'|^pear/packages|' => array('[email protected]'),
// PECL
- '|^php-src/pecl|' => array('[email protected]'),
+ '|^pecl|' => array('[email protected]'),
// QA-web
'|^web/qa|' => array('[email protected]'),
http://cvs.php.net/viewvc.cgi/SVNROOT/pear_avail?r1=1.9&r2=1.10&diff_format=u
Index: SVNROOT/pear_avail
diff -u SVNROOT/pear_avail:1.9 SVNROOT/pear_avail:1.10
--- SVNROOT/pear_avail:1.9 Mon Jun 29 23:51:00 2009
+++ SVNROOT/pear_avail Mon Jul 6 21:40:30 2009
@@ -35,9 +35,6 @@
avail|elf|pear/peardoc/ja
avail|elf,sheon|pear/peardoc/kr
-#phd pear theme
-avail|bjori,cweiske,loudi,saltybeagle|phd/themes/pear
-
# the pearbot module is for a bot for irc on the #pear channel on efnet.
avail|meebey,imajes,amir,pajoye,toby|pear/pearbot
http://cvs.php.net/viewvc.cgi/SVNROOT/pre-commit?r1=1.9&r2=1.10&diff_format=u
Index: SVNROOT/pre-commit
diff -u SVNROOT/pre-commit:1.9 SVNROOT/pre-commit:1.10
--- SVNROOT/pre-commit:1.9 Wed Jun 24 13:55:18 2009
+++ SVNROOT/pre-commit Mon Jul 6 21:40:30 2009
@@ -15,7 +15,7 @@
// -----------------------------------------------------------------------------------------------------------------------------
// Constants
-$version = substr('$Revision: 1.9 $', strlen('$Revision: '), -2);
+$version = substr('$Revision: 1.10 $', strlen('$Revision: '), -2);
$is_DEBUG = (isset($_ENV['DEBUG']) && $_ENV['DEBUG'] === 'DEBUG');
// -----------------------------------------------------------------------------------------------------------------------------
@@ -49,7 +49,7 @@
function pattern_matches_commit($pattern)
{
foreach ($GLOBALS['dirs_changed'] as $dir_changed) {
- if (!fnmatch($pattern, $dir_changed)) {
+ if (!preg_match($pattern, $dir_changed)) {
return FALSE;
}
}
@@ -91,7 +91,7 @@
// -----------------------------------------------------------------------------------------------------------------------------
// Read avail database
-if (pattern_matches_commit('*pear*')) {
+if (pattern_matches_commit('/^pear.*/')) {
$avail_db = dirname(__FILE__) . '/pear_avail';
} else {
$avail_db = dirname(__FILE__) . '/global_avail';
@@ -99,6 +99,17 @@
$avail_lines = file($avail_db);
// -----------------------------------------------------------------------------------------------------------------------------
+// Check for denied commits
+if (pattern_matches_commit('/^archived.*/')) {
+ fail("Commits to archived modules are not allowed.\n");
+}
+
+// Should match when tags is a component of the path but not the last component
+if (pattern_matches_commit('~/tags/.+~')) {
+ fail("Committing to a tag is not allowed.\n");
+}
+
+// -----------------------------------------------------------------------------------------------------------------------------
// Check commit against it
$exit_val = 0;
foreach ($dirs_changed as $dir_changed) {
@@ -156,7 +167,17 @@
}
if ($exit_val) {
- fail("Access denied: Insufficient karma for {$author} to {$last_dir}.\n");
+ if (preg_match('/^pear/', $last_dir)) {
+ $access_contact_email = '[email protected]';
+ } else if (preg_match('/^pecl/', $last_dir)) {
+ $access_contact_email = '[email protected]';
+ } else if (preg_match('/^phpdoc/', $last_dir)) {
+ $access_contact_email = '[email protected]';
+ } else {
+ $access_contact_email = '[email protected]';
+ }
+ fail("*******\nAccess denied: Insufficient karma for {$author} to {$last_dir}.\nContact {$access_contact_email} for access.\n");
+
}
if ($is_DEBUG) {
http://cvs.php.net/viewvc.cgi/SVNROOT/run-conversion.php?r1=1.67&r2=1.68&diff_format=u
Index: SVNROOT/run-conversion.php
diff -u SVNROOT/run-conversion.php:1.67 SVNROOT/run-conversion.php:1.68
--- SVNROOT/run-conversion.php:1.67 Mon Jul 6 21:21:05 2009
+++ SVNROOT/run-conversion.php Mon Jul 6 21:40:30 2009
@@ -7,7 +7,7 @@
// -----------------------------------------------------------------------------------------------------------------------------
// Constants
-$version = substr('$Revision: 1.67 $', strlen('$Revision: '), -2);
+$version = substr('$Revision: 1.68 $', strlen('$Revision: '), -2);
$passes = array(
'svncreate', // Create various SVN repositories
@@ -365,6 +365,7 @@
$cvs_modules = scandir_no_meta($cvsPath);
// Setup the basic directory structure in the CVS root for restructure purposes
+ mkdir("{$cvsPath}/archived");
mkdir("{$cvsPath}/gtk");
mkdir("{$cvsPath}/php");
mkdir("{$cvsPath}/pear");
@@ -376,24 +377,29 @@
if ($cvs_module == 'CVSROOT') {
continue;
}
- // Raw files in the cvs repo, empty directories (count(scandir()) == 2 (./..)), and selected obsolete modules are not converted.
- if (!is_dir("{$cvsPath}/{$cvs_module}") || count(scandir("{$cvsPath}/{$cvs_module}")) == 2 ||
- in_array($cvs_module, array('smarty', 'smarty-web', 'php4.fubar', 'php4.unused', 'peardoc.backup', 'php3', 'phpfi', 'livedocs',
- 'Zend', 'functable', 'dialin', 'docstuff', 'jpgraph', 'phpoc_de', 'phpdoc-fa_IR', 'lxr', 'portal', 'pres', 'embed', 'imapd',
- 'phpdoc-po'))) {
+ // Raw files in the cvs repo and empty directories (count(scandir()) == 2 (./..)) are not converted.
+ if (!is_dir("{$cvsPath}/{$cvs_module}") || count(scandir("{$cvsPath}/{$cvs_module}")) == 2) {
rm("{$cvsPath}/{$cvs_module}");
+ // Selected obsolete modules are archived in SVN
+ } else if (in_array($cvs_module, array('smarty', 'smarty-web', 'php4.fubar', 'php4.unused', 'peardoc.backup', 'php3', 'phpfi', 'livedocs',
+ 'Zend', 'functable', 'dialin', 'docstuff', 'jpgraph', 'phpdoc-fa_IR', 'lxr', 'portal', 'pres', 'embed', 'imapd',
+ 'phpdoc-po'))) {
+ mv("{$cvsPath}/{$cvs_module}", "{$cvsPath}/archived/{$cvs_module}");
// Modules belonging to PHP-GTK go into cvs/gtk/<module>
} else if (in_array($cvs_module, array('php-gtk', 'php-gtk-doc', 'old-php-gtk-modules', 'php-gtk-web'))) {
mv("{$cvsPath}/{$cvs_module}", "{$cvsPath}/gtk/{$cvs_module}");
$converter->addCVSModule("gtk/{$cvs_module}");
- // Modules belonging to the PHP base go into cvs/php/<module>. Note that this includes PECL!
- // PECL is a meta-module. (see CVS2SVNConverter::addCVSModule)
- } else if (in_array($cvs_module, array('ZendAPI', 'php-src', 'pecl', 'php-objc', 'php-lang',
+ // Modules belonging to the PHP base go into cvs/php/<module>.
+ } else if (in_array($cvs_module, array('ZendAPI', 'php-src', 'php-objc', 'php-lang',
'win-installer', 'bindlib_w32', 'zlib', 'pdo-specs', 'php-internals-win', 'fastcgi-isapi'))) {
mv("{$cvsPath}/{$cvs_module}", "{$cvsPath}/php/{$cvs_module}");
- $converter->addCVSModule("php/{$cvs_module}", $cvs_module == 'pecl');
- // Modules belonging to PEAR (especially the "modules" directory which contains all PEAR modules) go into cvs/pear/<module>
- // PEAR/modules is a meta-module. (see CVS2SVNConverter::addCVSModule)
+ $converter->addCVSModule("php/{$cvs_module}");
+ // PECL is a top-level meta-module (see CVS2SVNConverter::addCVSModule)
+ } else if ($cvs_module == 'pecl') {
+ $converter->addCVSModule($cvs_module, TRUE);
+ }
+ // Modules belonging to PEAR (especially the "packages" directory which contains all PEAR packages) go into cvs/pear/<module>
+ // PEAR/packages is a meta-module. (see CVS2SVNConverter::addCVSModule)
} else if (in_array($cvs_module, array('packages', 'pearbot', 'pear-core', 'peardoc', 'pearweb'))) {
mv("{$cvsPath}/{$cvs_module}", "{$cvsPath}/pear/{$cvs_module}");
$converter->addCVSModule("pear/{$cvs_module}", $cvs_module == 'packages');
@@ -454,7 +460,8 @@
$svnPath = $GLOBALS['options']['svnroot'];
v(2, "Checking out SVNROOT...\n");
- run_command("svn checkout " . escapeshellarg("file://{$GLOBALS['options']['svnroot']}/repository/SVNROOT/trunk") . ' ' . escapeshellarg("{$svnPath}/SVNROOT"));
+ run_command("svn checkout " . escapeshellarg("file://{$GLOBALS['options']['svnroot']}/repository/SVNROOT/trunk") . ' ' .
+ escapeshellarg("{$svnPath}/SVNROOT"));
v(2, "Installing start-commit hook...\n");
@unlink("{$svnPath}/repository/hooks/start-commit");
@@ -474,7 +481,7 @@
@unlink("{$svnPath}/repository/hooks/post-commit");
symlink("{$svnPath}/SVNROOT/post-commit", "{$svnPath}/repository/hooks/post-commit");
if (!is_executable("{$svnPath}/SVNROOT/post-commit")) {
- run_command("svn propset svn:executable 1 " . escaleshellarg("{$svnPath}/SVNROOT/post-commit"));
+ run_command("svn propset svn:executable 1 " . escapeshellarg("{$svnPath}/SVNROOT/post-commit"));
}
if (trim(implode("\n", run_command("svn status " . escapeshellarg("{$svnPath}/SVNROOT")))) !== "") {