#!/usr/bin/php
<?php
foreach( file( '/Users/chad/mw-repo-list' ) as $line ) {
list( $callsign, $oldname, $newname ) = explode( "\t", $line );
$newname = trim( $newname );
$prettyname = explode( '-', $newname, 2 );
$repoSpec = array(
'name' => $newname,
'vcs' => 'git',
'callsign' => $callsign,
"description" => "MediaWiki extension " . $prettyname[1],
"tracking" => true,
"uri" => "https://gerrit.wikimedia.org/r/p/$oldname",
"heraldEnabled" => false,
);
$repoSpec = json_encode( $repoSpec );
passthru( "echo '$repoSpec' | arc call-conduit repository.create" );
}