gwynne Sun Nov 9 22:32:32 2008 UTC Modified files: /SVNROOT run-conversion.php Log: linking pass to handle all those symlinks in php-src, ugh http://cvs.php.net/viewvc.cgi/SVNROOT/run-conversion.php?r1=1.29&r2=1.30&diff_format=u Index: SVNROOT/run-conversion.php diff -u SVNROOT/run-conversion.php:1.29 SVNROOT/run-conversion.php:1.30 --- SVNROOT/run-conversion.php:1.29 Sun Nov 9 06:37:09 2008 +++ SVNROOT/run-conversion.php Sun Nov 9 22:32:32 2008 @@ -7,13 +7,14 @@ // ----------------------------------------------------------------------------------------------------------------------------- // Constants -$version = substr('$Revision: 1.29 $', strlen('$Revision: '), -2); +$version = substr('$Revision: 1.30 $', strlen('$Revision: '), -2); $passes = array( 'processcvs', // Process CVS modules 'svncreate', // Create various SVN repositories 'cvs2svn', // Run conversion for each repository 'cleanup', // Preform renaming and removes for each repo + 'link', // Setup svn:externals 'install', // Install hook scripts, authz databases, etc. ); @@ -523,6 +524,61 @@ } // ----------------------------------------------------------------------------------------------------------------------------- +// link pass +function append_prop_line($path, $value) +{ + $oldValue = implode("\n", run_command('exec svn propget svn:externals ' . escapeshellarg($path))); + $oldValue .= "\n{$value}\n"; + run_command('exec svn propset svn:externals ' . escapeshellarg($oldValue) . ' ' . escapeshellarg($path)); +} + +function pass_link() +{ + $rawTagList = run_command('exec svn ls file:///' . escapeshellarg($GLOBALS['options']['svnroot'] . '/php-src/php-src/tags')); + $rawBranchList = run_command('exec svn ls file:///' . escapeshellarg($GLOBALS['options']['svnroot'] . '/php-src/php-src/branches')); + + $tagList = array(); + $branchList = array(); + foreach ($rawTagList as $tag) { + $realTag = substr($tag, 0, -1); + $xml = run_command('exec svn info --xml file:///' . escapeshellarg($GLOBALS['options']['svnroot'] . '/php-src/php-src/tags/' . $realTag)); + $tagList[$realTag] = strtotime(substr($xml, strpos($xml, '<date>') + 6, strpos($xml, '</date>'))); + } + foreach ($rawBranchList as $branch) { + $realBranch = substr($branch, 0, -1); + $xml = run_command('exec svn info --xml file:///' . escapeshellarg($GLOBALS['options']['svnroot'] . '/php-src/php-src/branches/' . $realBranch)); + $branchList[$realBranch] = strtotime(substr($xml, strpos($xml, '<date>') + 6, strpos($xml, '</date>'))); + } + + run_command('exec svn checkout file:///' . escapeshellarg($GLOBALS['options']['svnroot'] . '/php-src/php-src') . ' ' . + escapeshellarg($GLOBALS['temp_path'] . DIRECTORY_SEPARATOR . 'php-src-co') . ' 2>&1 > ' . + escapeshellarg($GLOBALS['temp_path'] . DIRECTORY_SEPARATOR . 'co-output')); + $oldcwd = getcwd(); + chdir($GLOBALS['temp_path'] . DIRECTORY_SEPARATOR . 'php-src-co'); + + $links = array('bz2', 'hash', 'oci8', 'pdo', 'pdo_dblib', 'pdo_firebird', 'spl', 'soap', 'sqlite', 'tidy', 'xmlreader', 'xmlwriter', 'filter', 'json', + 'ircg', 'pdo_mysql', 'pdo_oci', 'pdo_odbc', 'pdo_pgsql', 'pdo_sqlite', 'simplexml', 'fileinfo'); + + $props = array(); + + foreach ($links as $link) { + $info = lstat($GLOBALS['options']['cvsroot'] . DIRECTORY_SEPARATOR . 'php-src' . DIRECTORY_SEPARATOR . 'ext' . DIRECTORY_SEPARATOR . $link); + $createDate = $info['ctime']; + foreach ($tagList as $tag => $tagDate) { + if ($createDate <= $tagDate) { + append_prop_line('tags' . DIRECTORY_SEPARATOR . $tag . DIRECTORY_SEPARATOR . 'ext', "^/pecl/{$link}/tags/{$tag} {$link}"); + } + } + foreach ($branchList as $branch => $branchDate) { + if ($createDate <= $branchDate) { + append_prop_line('branches' . DIRECTORY_SEPARATOR . $branch . DIRECTORY_SEPARATOR . 'ext', "^/pecl/{$link}/branches/{$branch} {$link}"); + } + } + append_prop_line('trunk' . DIRECTORY_SEPARATOR . 'ext', "^/pecl/{$link}/trunk {$link}"); + } +} + +// ----------------------------------------------------------------------------------------------------------------------------- // install pass function pass_install() {
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php