cvs: SVNROOT / run-conversion.php

[email protected] ("Gwynne Raskind")
Newsgroups svn.migration
Message-ID <cvsgwynne1226530522@cvsserver>
gwynne		Wed Nov 12 22:55:22 2008 UTC

  Modified files:              
    /SVNROOT	run-conversion.php 
  Log:
  Shorter name for DIRECTORY_SEPARATOR
gwynne-20081112225522.txt (text/plain, 12.4 KB)
http://cvs.php.net/viewvc.cgi/SVNROOT/run-conversion.php?r1=1.41&r2=1.42&diff_format=u
Index: SVNROOT/run-conversion.php
diff -u SVNROOT/run-conversion.php:1.41 SVNROOT/run-conversion.php:1.42
--- SVNROOT/run-conversion.php:1.41	Mon Nov 10 04:37:49 2008
+++ SVNROOT/run-conversion.php	Wed Nov 12 22:55:21 2008
@@ -7,7 +7,7 @@
 
 // -----------------------------------------------------------------------------------------------------------------------------
 // Constants
-$version = substr('$Revision: 1.41 $', strlen('$Revision: '), -2);
+$version = substr('$Revision: 1.42 $', strlen('$Revision: '), -2);
 
 $passes = array(
     'processcvs',       // Process CVS modules
@@ -18,6 +18,8 @@
     'install',          // Install hook scripts, authz databases, etc.
 );
 
+define('DIR_SEP', DIRECTORY_SEPARATOR);
+
 // -----------------------------------------------------------------------------------------------------------------------------
 // Includes
 require_once 'Console/CommandLine.php';
@@ -174,7 +176,7 @@
     
     public function addCVSModule($moduleName, $isMetaModule = false)
     {
-        $cvspath = $GLOBALS['options']['cvsroot'] . DIRECTORY_SEPARATOR . $moduleName . DIRECTORY_SEPARATOR;
+        $cvspath = $GLOBALS['options']['cvsroot'] . DIR_SEP . $moduleName . DIR_SEP;
         if ($isMetaModule) {
             $modprefix = $moduleName . '/';
             foreach(scandir_no_meta($cvspath) as $module) {
@@ -199,23 +201,23 @@
         } else {
             if ($moduleName == 'php-src') {
                 // We special-case php-src so we can move TSRM and ZendEngine2 into it easily. Ugh.
-                $command = 'exec cp -Rpv ' . escapeshellarg($GLOBALS['options']['cvsroot'] . DIRECTORY_SEPARATOR . 'php-src') . ' ' .
-                                             escapeshellarg($GLOBALS['temp_path'] . DIRECTORY_SEPARATOR . 'php-src') .
-                                             ' 2>&1 > ' . escapeshellarg($GLOBALS['temp_path'] . DIRECTORY_SEPARATOR . 'cp-output');
+                $command = 'exec cp -Rpv ' . escapeshellarg($GLOBALS['options']['cvsroot'] . DIR_SEP . 'php-src') . ' ' .
+                                             escapeshellarg($GLOBALS['temp_path'] . DIR_SEP . 'php-src') .
+                                             ' 2>&1 > ' . escapeshellarg($GLOBALS['temp_path'] . DIR_SEP . 'cp-output');
                 run_command($command);
-                $command = 'exec cp -Rpv ' . escapeshellarg($GLOBALS['options']['cvsroot'] . DIRECTORY_SEPARATOR . 'ZendEngine2') . ' ' .
-                                             escapeshellarg($GLOBALS['temp_path'] . DIRECTORY_SEPARATOR . 'php-src') .
-                                             ' 2>&1 >> ' . escapeshellarg($GLOBALS['temp_path'] . DIRECTORY_SEPARATOR . 'cp-output');
+                $command = 'exec cp -Rpv ' . escapeshellarg($GLOBALS['options']['cvsroot'] . DIR_SEP . 'ZendEngine2') . ' ' .
+                                             escapeshellarg($GLOBALS['temp_path'] . DIR_SEP . 'php-src') .
+                                             ' 2>&1 >> ' . escapeshellarg($GLOBALS['temp_path'] . DIR_SEP . 'cp-output');
                 run_command($command);
-                $command = 'exec cp -Rpv ' . escapeshellarg($GLOBALS['options']['cvsroot'] . DIRECTORY_SEPARATOR . 'TSRM') . ' ' .
-                                             escapeshellarg($GLOBALS['temp_path'] . DIRECTORY_SEPARATOR . 'php-src') .
-                                             ' 2>&1 >> ' . escapeshellarg($GLOBALS['temp_path'] . DIRECTORY_SEPARATOR . 'cp-output');
+                $command = 'exec cp -Rpv ' . escapeshellarg($GLOBALS['options']['cvsroot'] . DIR_SEP . 'TSRM') . ' ' .
+                                             escapeshellarg($GLOBALS['temp_path'] . DIR_SEP . 'php-src') .
+                                             ' 2>&1 >> ' . escapeshellarg($GLOBALS['temp_path'] . DIR_SEP . 'cp-output');
                 run_command($command);
-                $command = 'exec cp -Rpv ' . escapeshellarg($GLOBALS['options']['cvsroot'] . DIRECTORY_SEPARATOR . 'CVSROOT') . ' ' .
+                $command = 'exec cp -Rpv ' . escapeshellarg($GLOBALS['options']['cvsroot'] . DIR_SEP . 'CVSROOT') . ' ' .
                                              escapeshellarg($GLOBALS['temp_path']) .
-                                             ' 2>&1 >> ' . escapeshellarg($GLOBALS['temp_path'] . DIRECTORY_SEPARATOR . 'cp-output');
+                                             ' 2>&1 >> ' . escapeshellarg($GLOBALS['temp_path'] . DIR_SEP . 'cp-output');
                 run_command($command, TRUE);
-                $cvspath = $GLOBALS['temp_path'] . DIRECTORY_SEPARATOR . 'php-src';
+                $cvspath = $GLOBALS['temp_path'] . DIR_SEP . 'php-src';
             }
             $this->optionsFileContents .= <<<EOEXTRA
 run_options.add_project(
@@ -234,14 +236,14 @@
     public function run()
     {
         $this->optionsFileContents = str_replace('@@@OUTPUT_PATH@@@', $this->outputPath, $this->optionsFileContents);
-        $filename = $GLOBALS['temp_path'] . DIRECTORY_SEPARATOR . 'cvs2svn.options.' . $this->seed;
+        $filename = $GLOBALS['temp_path'] . DIR_SEP . 'cvs2svn.options.' . $this->seed;
         file_put_contents($filename, $this->optionsFileContents);
 
         $command = "exec cvs2svn --options=" . escapeshellarg($filename);
         v(2, "Running: '{$command}'...");
         $cvs2svn_process = proc_open($command, array(
                 0 => array('pipe', 'r'),
-                1 => array('file', $GLOBALS['temp_path'] . DIRECTORY_SEPARATOR . 'phpsvn.conversion.' . $this->seed, 'w'),
+                1 => array('file', $GLOBALS['temp_path'] . DIR_SEP . 'phpsvn.conversion.' . $this->seed, 'w'),
                 2 => array('pipe', 'w'),
             ), $pipes, NULL, NULL);
         fclose($pipes[0]);
@@ -272,7 +274,7 @@
     public function __construct($repoName)
     {
         $this->repositoryName = $repoName;
-        $this->svnRepositoryPath = $GLOBALS['options']['svnroot'] . DIRECTORY_SEPARATOR . $this->repositoryName;
+        $this->svnRepositoryPath = $GLOBALS['options']['svnroot'] . DIR_SEP . $this->repositoryName;
     }
     
     public function __toString()
@@ -390,7 +392,7 @@
 v(1, "PHP Group CVS->SVN respository conversion.\n");
 v(1, "Started at " . date(DATE_RFC2822) . "\n");
 
-$temp_path = $options['tempdir'] . DIRECTORY_SEPARATOR . "phpsvn_tmp";
+$temp_path = $options['tempdir'] . DIR_SEP . "phpsvn_tmp";
 v(2, "Creating temporary files directory at {$temp_path}...\n");
 
 if (!file_exists($temp_path)) {
@@ -428,8 +430,8 @@
         if ($cvs_module == 'CVSROOT') {
             continue;
         }
-        if (!is_dir($options['cvsroot'] . DIRECTORY_SEPARATOR . $cvs_module) ||
-                count(scandir($options['cvsroot'] . DIRECTORY_SEPARATOR . $cvs_module)) == 2) {    // empty
+        if (!is_dir($options['cvsroot'] . DIR_SEP . $cvs_module) ||
+                count(scandir($options['cvsroot'] . DIR_SEP . $cvs_module)) == 2) {    // empty
             continue;
         }
         if (in_array($cvs_module, array('smarty', 'smarty-web', 'php4.fubar', 'php4.unused', 'peardoc.backup', 'php3', 'phpfi', 'livedocs',
@@ -530,13 +532,13 @@
     $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'));
     
-    if (!file_exists($GLOBALS['temp_path'] . DIRECTORY_SEPARATOR . 'php-src-co')) {
+    if (!file_exists($GLOBALS['temp_path'] . DIR_SEP . 'php-src-co')) {
         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'));
+            escapeshellarg($GLOBALS['temp_path'] . DIR_SEP . 'php-src-co') . ' 2>&1 > ' .
+            escapeshellarg($GLOBALS['temp_path'] . DIR_SEP . 'co-output'));
     }
     $oldcwd = getcwd();
-    chdir($GLOBALS['temp_path'] . DIRECTORY_SEPARATOR . 'php-src-co');
+    chdir($GLOBALS['temp_path'] . DIR_SEP . 'php-src-co');
     
     $tagList = array();
     $branchList = array();
@@ -545,16 +547,16 @@
         $xml = run_command('exec svn info --xml file:///' . escapeshellarg($GLOBALS['options']['svnroot'] . '/php-src/php-src/tags/' . $realTag));
         $xml = implode("\n", $xml);
         $tagList[$realTag] = strtotime(substr($xml, strpos($xml, '<date>') + 6, strlen('0000-00-00T00:00:00.000000Z')));
-        run_command('exec svn propdel svn:externals ' . escapeshellarg('tags' . DIRECTORY_SEPARATOR . $realTag . DIRECTORY_SEPARATOR . 'ext') . ' 2>&1');
+        run_command('exec svn propdel svn:externals ' . escapeshellarg('tags' . DIR_SEP . $realTag . DIR_SEP . 'ext') . ' 2>&1');
     }
     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));
         $xml = implode("\n", $xml);
         $branchList[$realBranch] = strtotime(substr($xml, strpos($xml, '<date>') + 6, strlen('0000-00-00T00:00:00.000000Z')));
-        run_command('exec svn propdel svn:externals ' . escapeshellarg('branches' . DIRECTORY_SEPARATOR . $realBranch . DIRECTORY_SEPARATOR . 'ext') . ' 2>&1');
+        run_command('exec svn propdel svn:externals ' . escapeshellarg('branches' . DIR_SEP . $realBranch . DIR_SEP . 'ext') . ' 2>&1');
     }
-    run_command('exec svn propdel svn:externals ' . escapeshellarg('trunk' . DIRECTORY_SEPARATOR . 'ext') . ' 2>&1');
+    run_command('exec svn propdel svn:externals ' . escapeshellarg('trunk' . DIR_SEP . 'ext') . ' 2>&1');
     
     $links = array('bz2', 'hash', 'oci8', 'pdo', 'pdo_dblib', 'pdo_firebird', 'spl', 'soap', 'sqlite', 'tidy', 'xmlreader', 'xmlwriter', 'filter', 'json',
         'pdo_mysql', 'pdo_oci', 'pdo_odbc', 'pdo_pgsql', 'pdo_sqlite', 'simplexml', 'fileinfo');
@@ -562,21 +564,21 @@
     $props = array();
     
     foreach ($links as $link) {
-        $info = lstat($GLOBALS['options']['cvsroot'] . DIRECTORY_SEPARATOR . 'php-src' . DIRECTORY_SEPARATOR . 'ext' . DIRECTORY_SEPARATOR . $link);
+        $info = lstat($GLOBALS['options']['cvsroot'] . DIR_SEP . 'php-src' . DIR_SEP . 'ext' . DIR_SEP . $link);
         $createDate = $info['ctime'];
         foreach ($tagList as $tag => $tagDate) {
-            $path = 'tags' . DIRECTORY_SEPARATOR . $tag . DIRECTORY_SEPARATOR . 'ext';
+            $path = 'tags' . DIR_SEP . $tag . DIR_SEP . 'ext';
             if ($createDate <= $tagDate) {
                 $props[$path] = (isset($props[$path]) ? $props[$path] : '') . "^/pecl/{$link}/tags/{$tag} {$link}\n";
             }
         }
         foreach ($branchList as $branch => $branchDate) {
-            $path = 'branches' . DIRECTORY_SEPARATOR . $branch . DIRECTORY_SEPARATOR . 'ext';
+            $path = 'branches' . DIR_SEP . $branch . DIR_SEP . 'ext';
             if ($createDate <= $branchDate) {
                 $props[$path] = (isset($props[$path]) ? $props[$path] : '') . "^/pecl/{$link}/branches/{$branch} {$link}\n";
             }
         }
-        $path = 'trunk' . DIRECTORY_SEPARATOR . 'ext';
+        $path = 'trunk' . DIR_SEP . 'ext';
         $props[$path] = (isset($props[$path]) ? $props[$path] : '') . "^/pecl/{$link}/trunk {$link}\n";
     }
 
@@ -595,8 +597,8 @@
     foreach ($GLOBALS['repoList'] as $repo) {
         $repo->installAdminFiles();
     }
-    if (!file_exists($GLOBALS['options']['svnroot'] . DIRECTORY_SEPARATOR . 'svn.authz')) {
-        file_put_contents($GLOBALS['options']['svnroot'] . DIRECTORY_SEPARATOR . 'svn.authz', <<<EOAUTHZ
+    if (!file_exists($GLOBALS['options']['svnroot'] . DIR_SEP . 'svn.authz')) {
+        file_put_contents($GLOBALS['options']['svnroot'] . DIR_SEP . 'svn.authz', <<<EOAUTHZ
 [groups]
 
 [aliases]
@@ -606,8 +608,8 @@
 EOAUTHZ
         );
     }
-    if (!file_exists($GLOBALS['options']['svnroot'] . DIRECTORY_SEPARATOR . 'svn.users')) {
-        $command = 'htpasswd -bcm ' . escapeshellarg($GLOBALS['options']['svnroot'] . DIRECTORY_SEPARATOR . 'svn.users') . ' svnread svnread';
+    if (!file_exists($GLOBALS['options']['svnroot'] . DIR_SEP . 'svn.users')) {
+        $command = 'htpasswd -bcm ' . escapeshellarg($GLOBALS['options']['svnroot'] . DIR_SEP . 'svn.users') . ' svnread svnread';
         run_command($command);
     }
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.