num_rows > 0) {
$count = 0;
while($row = $result->fetch_assoc()) {
if (($to_show == "next") &&
($row["loops"]==0) &&
($row["dependencies_pending"]==1))
continue;
$fail_result = mysql_run_query(
"SELECT " .
"`fail_reasons`.`name`, " .
"`failed_builds`.`log_file` " .
"FROM `failed_builds` " .
"JOIN `fail_reasons` ON `failed_builds`.`reason`=`fail_reasons`.`id` " .
"WHERE `failed_builds`.`build_assignment`=".$row["id"]." " .
"ORDER BY `failed_builds`.`date`"
);
unset($reasons);
$rows[$count]["trials"] = $fail_result -> num_rows;
if ($rows[$count]["trials"] > 0) {
while($fail_row = $fail_result->fetch_assoc()) {
$reasons[$fail_row["name"]] = $fail_row["log_file"];
}
}
if (isset($reasons)) {
$to_print="";
foreach ($reasons as $reason => $last_log) {
$to_print= $to_print .
", " .
$reason .
"";
}
$rows[$count]["fail_reasons"]=substr($to_print,2);
} else {
$rows[$count]["fail_reasons"]=" ";
}
$rows[$count]["loops"] = $row["loops"];
$rows[$count]["pkgbase"] = $row["pkgbase"];
if ($row["dependencies_pending"]=="0")
$rows[$count]["pkgbase_print"] = $rows[$count]["pkgbase"];
else
$rows[$count]["pkgbase_print"] = "(" . $rows[$count]["pkgbase"] . ")";
$rows[$count]["pkgbase_print"] =
"" .
$rows[$count]["pkgbase_print"] .
"";
if ($row["uses_upstream"]) {
$rows[$count]["git_revision"] =
"" .
$row["git_revision"] . "";
} else
$rows[$count]["git_revision"] = $row["git_revision"];
if ($row["uses_modification"])
$rows[$count]["mod_git_revision"] =
"" .
$row["mod_git_revision"] . "";
else
$rows[$count]["mod_git_revision"] = $row["mod_git_revision"];
$rows[$count]["package_repository"] = $row["package_repository"];
$rows[$count]["commit_time"] = $row["commit_time"];
if ($row["is_blocked"]=="") {
$rows[$count]["is_blocked"]=" ";
}
else {
$rows[$count]["is_blocked"] = preg_replace(
array (
"/FS32#(\\d+)/",
"/FS#(\\d+)/"
),
array (
"$0",
"$0"
),
$row["is_blocked"]
);
}
if (isset($row["build_slave"]))
$rows[$count]["build_slave"] = $row["build_slave"];
else
$rows[$count]["build_slave"] = " ";
$count++;
}
}
$columns = array(
"package" => "pkgbase_print",
"git revision" => "git_revision",
"modification git revision" => "mod_git_revision",
"package repository" => "package_repository",
"commit time" => "commit_time",
"compilations" => "trials",
"loops" => "loops",
"build error" => "fail_reasons",
"blocked" => "is_blocked",
"handed out to" => "build_slave"
);
print_header("List of " . strtoupper(substr($to_show,0,1)) . substr($to_show,1) . " Package Builds");
show_warning_on_offline_slave();
print "build logs
\n";
if ($count > 0) {
usort(
$rows,
function (array $a, array $b) {
if ($a["trials"] < $b["trials"])
return -1;
if ($a["trials"] > $b["trials"])
return 1;
return strcmp($a["pkgbase"],$b["pkgbase"]);
}
);
?>
\n"; print " " . $title . "\n"; print " | \n"; } ?>\n"; print " " . $row[$content] . "\n"; print " | \n"; } print " \n"; if ($oddity == "odd" ) $oddity = "even"; else $oddity = "odd"; } ?>
---|