\n";
foreach ($pkgs as $key => $p) {
if (trim($p['package']) == '') {
continue;
}
if ($p['type'] != 'uploaded') {
continue;
}
$failed_arches = array_keys($p['status']['fail']);
if (empty($failed_arches)) {
continue;
}
if(!file_exists(get_srpm_path($p['version'], $p['media'], $p['section'], $p['package']))) {
continue;
}
echo '
' . $p['package'] . ' | ';
$status_file = $upload_dir . '/failure/' . $p['path'] . '/log/status.log';
$status_line = trim(preg_replace('/.*: /', '', file_get_contents($status_file)));
if ($status_line == 'missing_dep') {
$install_deps_files = glob($upload_dir . '/failure/' . $p['path'] . '/log/*/install_deps*.log');
$install_deps_file = $install_deps_files[count($install_deps_files)-1];
$f = fopen($install_deps_file, "r");
$dep_line = "";
while(($line = fgets($f, 4096)) !== false) {
if(preg_match('/due to unsatisfied (.*)\)/', $line, $matches) == 1) {
$dep_line = $matches[1];
}
}
fclose($f);
$link = str_replace($upload_dir, '/uploads', $install_deps_file);
echo '' . $status_line . ' ' . $dep_line . ' | ';
} elseif ($status_line == 'recreate_srpm_failure') {
$botcmd_files = glob($upload_dir . '/failure/' . $p['path'] . '/log/botcmd.*.log');
$link = str_replace($upload_dir, '/uploads', $botcmd_files[0]);
echo '' . $status_line . ' | ';
} else {
$dirs = glob($upload_dir . '/failure/' . $p['path'] . '/log/*/');
$link = str_replace($upload_dir, '/uploads', $dirs[0]);
echo '' . $status_line . ' | ';
}
echo "
\n";
}
echo "\n";
?>