"Main deps x86_64",
"main-ready" => "Main ready deps x86_64",
"main-ready-test" => "Main+ready+test deps x86_64",
"main-i686" => "Main deps i686",
"main-ready-i686" => "Main ready deps i686",
"main-ready-test-i686" => "Main+ready+test deps i686",
"main-x32" => "Main deps x32",
"main-ready-x32" => "Main ready deps x32",
"main-ready-test-x32" => "Main+ready+test deps x32",
"freshness" => "GIT vs FTP freshness",
"lint-PLD" => "rpmlint: main",
"lint-test" => "rpmlint: test",
"lint-ready" => "rpmlint: ready",
);
function reports_selection($reports) {
global $report;
echo "Select report:";
echo "\n";
}
/**
* Create text input for filtering results
*/
function filter_box() {
echo '
Filter results: ';
echo '
? errors';
}
function format_report($report) {
echo "
View the raw report
\n";
$file = "$report.txt";
$giturl = 'http://git.pld-linux.org/gitweb.cgi?p=packages/%1$s.git;f=%1$s.spec;h=HEAD;a=shortlog';
echo '';
foreach (file($file) as $line) {
$line = preg_replace_callback('/^(?Perror:|GIT:)\s*\[(?P[^]]+)\]\s*(?P.+)$/', function($m) use ($giturl) {
$package = basename($m['spec'], '.spec');
$url = sprintf($giturl, $package);
return sprintf('- %s [%s] %s', $m['prefix'], $url, $m['spec'], $m['msg']);
}, $line);
echo $line, "
\n";
}
echo '
';
}
reports_selection($reports);
filter_box();
if (isset($reports[$report])) {
format_report($report);
}
?>