Skip to content

Commit

Permalink
Arm the mirror script :)
Browse files Browse the repository at this point in the history
  • Loading branch information
CloCkWeRX committed Apr 13, 2012
1 parent 4cec069 commit 5c7d9da
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions admin-mirror-all.php
Expand Up @@ -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.