cvs: SVNROOT / run-conversion.php

[email protected] ("Gwynne Raskind")
Newsgroups svn.migration
Message-ID <cvsgwynne1228689344@cvsserver>
gwynne		Sun Dec  7 22:35:44 2008 UTC

  Modified files:              
    /SVNROOT	run-conversion.php 
  Log:
  add ignores phase, remove links before conversion for later externals linking
  
http://cvs.php.net/viewvc.cgi/SVNROOT/run-conversion.php?r1=1.54&r2=1.55&diff_format=u
Index: SVNROOT/run-conversion.php
diff -u SVNROOT/run-conversion.php:1.54 SVNROOT/run-conversion.php:1.55
--- SVNROOT/run-conversion.php:1.54	Sat Dec  6 16:48:47 2008
+++ SVNROOT/run-conversion.php	Sun Dec  7 22:35:43 2008
@@ -7,12 +7,13 @@
 
 // -----------------------------------------------------------------------------------------------------------------------------
 // Constants
-$version = substr('$Revision: 1.54 $', strlen('$Revision: '), -2);
+$version = substr('$Revision: 1.55 $', strlen('$Revision: '), -2);
 
 $passes = array(
     'processcvs',       // Process CVS modules
     'svncreate',        // Create various SVN repositories
     'cvs2svn',          // Run conversion for each repository
+    'ignores',          // Convert .cvsignore to svn:ignore
     'link',             // Setup svn:externals
     'install',          // Install hook scripts, authz databases, etc.
 );
@@ -294,6 +295,12 @@
     mv("{$cvsPath}/ZendEngine2", "{$cvsPath}/php-src/ZendEngine2");
     mv("{$cvsPath}/pdo-specs", "{$cvsPath}/pecl/pdo/specs");
     
+    $links = array('bz2', 'hash', 'oci8', 'pdo', 'pdo_dblib', 'pdo_firebird', 'spl', 'soap', 'sqlite', 'tidy', 'xmlreader', 'xmlwriter', 'filter', 'ircg',
+        'json', 'pdo_mysql', 'pdo_oci', 'pdo_odbc', 'pdo_pgsql', 'pdo_sqlite', 'simplexml', 'fileinfo');
+    foreach ($links as $link) {
+        rm("{$cvsPath}/php-src/ext/{$link}");
+    }
+
     $cvs_modules = scandir_no_meta($cvsPath);
 
     mkdir("{$cvsPath}/gtk");
@@ -387,6 +394,34 @@
 }
 
 // -----------------------------------------------------------------------------------------------------------------------------
+// ignores pass
+function pass_ignores()
+{
+    $svnPath = "{$GLOBALS['options']['svnroot']}/repository";
+    $coDir = "{$GLOBALS['temp_path']}/ignore_co";
+    $dirStack = array($svnPath);
+    $oldCwd = getcwd();
+    
+    while (($curDir = array_pop($dirStack)) !== NULL) {
+        $itemList = run_command('svn ls file:///' . escapeshellarg($curDir));
+        if (in_array('.cvsignore', $itemList)) {
+            run_command('svn co --depth immediates file:///' . escapeshellarg($curDir) . ' ' . escapeshellarg($coDir));
+            chdir($coDir);
+            run_command('svn propset svn:ignore -F .cvsignore .');
+            run_command('svn remove .cvsignore');
+            run_command('svn commit -m ' . escapeshellarg("[SVN CONVERSION] Convert .cvsignore to svn:ignore") . ' .');
+            chdir($oldCwd);
+            rm($coDir);
+        }
+        foreach ($itemList as $item) {
+            if (substr($item, -1) == '/') {
+                array_push($dirStack, "{$curDir}/{$item}");
+            }
+        }
+    }
+}
+
+// -----------------------------------------------------------------------------------------------------------------------------
 // link pass
 function pass_link()
 {
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.