nlopess Thu Aug 9 17:55:17 2007 UTC
Added files:
/phpdoc/scripts/iniupdate cvs-versions run.php
Removed files:
/phpdoc/scripts/iniupdate update-all
Modified files:
/phpdoc/scripts/iniupdate cvs-versions.php update-all.php
Log:
continue the branch/tags automation
http://cvs.php.net/viewvc.cgi/phpdoc/scripts/iniupdate/cvs-versions.php?r1=1.3&r2=1.4&diff_format=u
Index: phpdoc/scripts/iniupdate/cvs-versions.php
diff -u phpdoc/scripts/iniupdate/cvs-versions.php:1.3
phpdoc/scripts/iniupdate/cvs-versions.php:1.4
--- phpdoc/scripts/iniupdate/cvs-versions.php:1.3 Mon Dec 26 12:12:12 2005
+++ phpdoc/scripts/iniupdate/cvs-versions.php Thu Aug 9 17:55:16 2007
@@ -17,27 +17,75 @@
+----------------------------------------------------------------------+
*/
+
+/** fetch the PHP release tags */
+function get_php_release_tags()
+{
+ static $tags = null;
+
+ if ($tags) return $tags;
+
+ chdir('sources');
+ `cvs -q -d :pserver:[EMAIL PROTECTED]:/repository co php-src > /dev/null`;
+ chdir('php-src');
+
+ $log = explode("\n", `cvs log ChangeLog`);
+ chdir('../..');
+
+ do {
+ $l = array_shift($log);
+ if ($l == 'symbolic names:') {
+ break;
+ }
+ } while (1);
+
+ $tags = array();
+ foreach ($log as $l) {
+ if (substr($l, 0, 1) != "\t") {
+ break;
+ }
+ list($tag) = explode(': ', trim($l));
+ if (preg_match('/^PHP_[456]_[0-9]+_[0-9]+$/i', $tag)) {
+ $tags[] = $tag;
+ }
+ }
+
+ natcasesort($tags);
+ $tags = array_map('strtoupper', $tags);
+ $tags = array_unique($tags);
+
+ return $tags;
+}
+
+
// fetch all version tags
-$tags = array();
-foreach (glob('*.tags') as $file) {
- $tmp = array_map('rtrim', file($file));
- $last_versions[] = substr(end($tmp), 4); // this is the last released
version from a major version
- $tags = array_merge($tags, $tmp);
+$tags = get_php_release_tags();
+$lasttag = 'PHP_4_0_0';
+
+foreach (array_merge($tags, array('php_head')) as $tag) {
+ if ($tag[4] === $lasttag[4]) {
+ $lasttag = $tag;
+ continue;
+ }
+
+ $last_versions[] = substr($lasttag, 4); // this is the last released
version from a major version
+ $lasttag = $tag;
}
// fetch cvs versions
-$file = file_get_contents('./update-all');
+$file = file_get_contents('./cvs-versions');
preg_match_all('/PHP_(\d)_CVS=(\w+)/', $file, $data, PREG_SET_ORDER);
-$cvs_versions = array();
+$cvs_versions = $cvs_branches = array();
foreach ($data as $v) {
- if ($v[2] == 'HEAD') {
- $version = "$v[1].0.0";
- } else {
- $version = make_cvs_version(substr($v[2], 4));
- }
- $cvs_versions["php_$v[1]_cvs"] = $version;
+ if ($v[2] == 'HEAD') {
+ $version = "$v[1].0.0";
+ } else {
+ $version = make_cvs_version(substr($v[2], 4));
+ }
+ $cvs_versions["php_$v[1]_cvs"] = $version;
+ $cvs_branches[$v[1]] = $v[2];
}
$tags = array_merge(array_keys($cvs_versions), $tags);
http://cvs.php.net/viewvc.cgi/phpdoc/scripts/iniupdate/update-all.php?r1=1.1&r2=1.2&diff_format=u
Index: phpdoc/scripts/iniupdate/update-all.php
diff -u phpdoc/scripts/iniupdate/update-all.php:1.1
phpdoc/scripts/iniupdate/update-all.php:1.2
--- phpdoc/scripts/iniupdate/update-all.php:1.1 Thu Aug 9 16:59:09 2007
+++ phpdoc/scripts/iniupdate/update-all.php Thu Aug 9 17:55:16 2007
@@ -17,36 +17,10 @@
+----------------------------------------------------------------------+
*/
-/** fetch the PHP release tags */
-function get_php_release_tags()
-{
- chdir('php-src');
-
- $log = explode("\n", `cvs log ChangeLog`);
-
- do {
- $l = array_shift($log);
- if ($l == 'symbolic names:') {
- break;
- }
- } while (1);
-
- $tags = array();
- foreach ($log as $l) {
- if (substr($l, 0, 1) != "\t") {
- break;
- }
- list($tag,) = explode(': ', trim($l));
- if (preg_match('/^PHP_[456]_[0-9]+_[0-9]+$/i', $tag)) {
- $tags[] = $tag;
- }
- }
-
- chdir('..');
+require_once './cvs-versions.php';
- return array_reverse($tags);
-}
+/** fetch a tag sources */
function checkout_tag($tag)
{
if (is_dir($tag)) {
@@ -75,16 +49,16 @@
}
-// update HEAD
-echo "updating cvs HEAD... ";
-chdir('sources');
-$cmd = 'cvs -q -d :pserver:[EMAIL PROTECTED]:/repository co php-src >
/dev/null';
-//exec($cmd);
-echo "done\n";
-
foreach (get_php_release_tags() as $tag) {
$tag = strtoupper($tag);
echo "Getting tag: $tag... ";
checkout_tag($tag);
}
+foreach ($cvs_branches as $tag => $branch) {
+ echo "Getting tag: $tag... ";
+ $cmd = "cvs -q -d :pserver:[EMAIL PROTECTED]:/repository co -d
".strtolower($tag)." -r $branch php-src";
+ exec($cmd);
+ echo "done\n";
+}
+
http://cvs.php.net/viewvc.cgi/phpdoc/scripts/iniupdate/run.php?view=markup&rev=1.1
Index: phpdoc/scripts/iniupdate/run.php
+++ phpdoc/scripts/iniupdate/run.php
<?php
/*
+----------------------------------------------------------------------+
| ini doc settings updater |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2007 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_0.txt. |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| [EMAIL PROTECTED] so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Nuno Lopes <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
@mkdir('sources');
require_once './update-all.php';
if (is_file('ini_changelog.sqlite')) {
require_once './make_db.php';
require_once './insert_db.php';
} else {
require_once './update_db.php';
}
require_once './ini-update.php';