From 20e678cae2d84021bdbe36b20de252f91e181f47 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 23 Jan 2018 22:29:58 +0100 Subject: web-scripts/broken-packages.php: sort broken packages --- web-scripts/broken-packages.php | 98 ++++++++++++++++++++++++++--------------- 1 file changed, 62 insertions(+), 36 deletions(-) (limited to 'web-scripts/broken-packages.php') diff --git a/web-scripts/broken-packages.php b/web-scripts/broken-packages.php index cccf18b..866c96b 100644 --- a/web-scripts/broken-packages.php +++ b/web-scripts/broken-packages.php @@ -26,17 +26,8 @@ $result = $mysql -> query( "WHERE `build_assignments`.`is_broken` OR `build_assignments`.`is_blocked` IS NOT NULL" ); if ($result -> num_rows > 0) { - print "\n"; - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; -// print ""; - print ""; - print ""; - print "\n"; + + $count = 0; while($row = $result->fetch_assoc()) { @@ -53,11 +44,11 @@ if ($result -> num_rows > 0) { unset($reasons); unset($last_log); - $trials = $fail_result -> num_rows; - if ($trials > 0) { + $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["name"]; - $last_log=$fail_row["log_file"]; + $reasons[$fail_row["name"]] = $fail_row["name"]; + $last_log = $fail_row["log_file"]; } } if (isset($reasons)) { @@ -65,37 +56,72 @@ if ($result -> num_rows > 0) { foreach ($reasons as $reason) { $to_print=$to_print.", ".$reason; } - $fail_reasons=substr($to_print,2); + $rows[$count]["fail_reasons"]=substr($to_print,2); } else { - $fail_reasons=" "; + $rows[$count]["fail_reasons"]=" "; } + $rows[$count]["pkgbase"] = $row["pkgbase"]; + $rows[$count]["git_revision"] = $row["git_revision"]; + $rows[$count]["mod_git_revision"] = $row["mod_git_revision"]; + $rows[$count]["name"] = $row["name"]; + if (isset($rows[$count]["last_log"])) + $rows[$count]["print_trials"]="". $rows[$count]["trials"] .""; + else + $rows[$count]["print_trials"]=$rows[$count]["trials"]; + 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"] + ); + } + $count++; + } + + 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"]); + } + ); + + print "
packagegit revisionmodification git revisionpackage repositorycompilationsdependentbuild errorblocked
\n"; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; +// print ""; + print ""; + print ""; + print "\n"; + + foreach($rows as $row) { + print ""; print ""; print ""; print ""; print ""; - if (isset($last_log)) - print ""; - else - print ""; + print ""; // - print ""; - if ($row["is_blocked"]=="") { - $row["is_blocked"]=" "; - } - $row["is_blocked"] = preg_replace( - array ( - "/FS32#(\\d+)/", - "/FS#(\\d+)/" - ), - array ( - "$0", - "$0" - ), - $row["is_blocked"] - ); + print ""; print ""; print "\n"; -- cgit v1.2.3-70-g09d2
packagegit revisionmodification git revisionpackage repositorycompilationsdependentbuild errorblocked
".$row["pkgbase"]."

".$row["git_revision"]."

".$row["mod_git_revision"]."

".$row["name"]."". $trials ."". $trials ."".$row["print_trials"]."0".$fail_reasons."".$row["fail_reasons"]."".$row["is_blocked"]."