Permalink
Browse files

Arm the mirror script :)

  • Loading branch information...
1 parent 4cec069 commit 5c7d9da08b623e8ee061e74301088503c16cc6d1 @CloCkWeRX CloCkWeRX committed Apr 13, 2012
Showing with 20 additions and 8 deletions.
  1. +20 −8 admin-mirror-all.php
View
@@ -5,15 +5,27 @@
$packages = preg_split('/[\r\n]+/', $result);
foreach ($packages as $package) {
+ if ($package == 'installphars') { continue; }
+ if ($package == 'AllTests.php') { continue; }
+
$workbench = $package . "-workbench";
if (!file_exists($workbench)) {
- print "mkdir ". $workbench . "\n";
- print "cd " . $workbench . "\n";
- print "git-svn-mirror init --authors=../authors.txt --from=http://svn.php.net/repository/pear/packages/" . $package . "/ --to=git@github.com:pear/" . $package . ".git\n";
- print "cd ..\n";
- } else {
- print "cd " . $workbench . "\n";
- print "git-svn-mirror update \n";
- print "cd ..\n";
+ $paths = array();
+ $paths[] = "mkdir ". $workbench;
+ $paths[] = "cd " . $workbench;
+ $paths[] = "git-svn-mirror init --authors=../authors.txt --from=http://svn.php.net/repository/pear/packages/" . $package . "/ --to=git@github.com:pear/" . $package . ".git";
+ $paths[] = "cd ..";
+ shell_exec(implode("&&", $paths));
+
+ }
+}
+
+foreach ($packages as $package) {
+ if ($package == 'installphars') { continue; }
+ if ($package == 'AllTests.php') { continue; }
+
+ $workbench = $package . "-workbench";
+ if (file_exists($workbench)) {
+ shell_exec("git-svn-mirror update $workbench");
}
}

0 comments on commit 5c7d9da

Please sign in to comment.