diff options
author | Pascal Terjan <pterjan@gmail.com> | 2014-05-23 21:19:36 +0000 |
---|---|---|
committer | Pascal Terjan <pterjan@gmail.com> | 2014-05-23 21:19:36 +0000 |
commit | 3e7830cb82c8244c6b7c5793d9c623a763f09593 (patch) | |
tree | 9180f9e18122612196d7a063a189422154881128 /autobuild | |
parent | 4b3bd9faa7c060b86a471832b8c535beb6daf976 (diff) | |
download | pkgsubmit-3e7830cb82c8244c6b7c5793d9c623a763f09593.tar pkgsubmit-3e7830cb82c8244c6b7c5793d9c623a763f09593.tar.gz pkgsubmit-3e7830cb82c8244c6b7c5793d9c623a763f09593.tar.bz2 pkgsubmit-3e7830cb82c8244c6b7c5793d9c623a763f09593.tar.xz pkgsubmit-3e7830cb82c8244c6b7c5793d9c623a763f09593.zip |
Fix fixed packages detection and hide successful packages
Diffstat (limited to 'autobuild')
-rw-r--r-- | autobuild/results.php | 65 |
1 files changed, 56 insertions, 9 deletions
diff --git a/autobuild/results.php b/autobuild/results.php index d7f0660..9172a57 100644 --- a/autobuild/results.php +++ b/autobuild/results.php @@ -76,12 +76,26 @@ if (!file_exists($status_name)) { exit; } +$start_time = 0; +if (file_exists("$base_dir/VERSION")) { +#Mageia 5 Devel-i586-Download 20140311 15:50 +#Mageia 5 Devel-x86_64-Download 20140311 15:50 + $version = file_get_contents("$base_dir/VERSION"); + preg_match('/ (\d{8} \d{2}:\d{2})$/', $version, $matches); + $start_time = strtotime($matches[1]); +} $status_file = fopen($status_name, "r"); while (!feof($status_file)) { $line = fgets($status_file); if (preg_match("/^(.*): (.*)$/", $line, $matches)) { $rpm = $matches[1]; $status = $matches[2]; + if ($start_time == 0) { + $build_stat = stat("$base_dir/$rpm"); + if ($build_stat['mtime']) { + $start_time = $build_stat['mtime']; + } + } if ($status == "ok") { array_push($success, $rpm); } elseif ($status != "unknown" && $status != "not_on_this_arch"){ @@ -96,7 +110,7 @@ while (!feof($status_file)) { } else { $build_stat = stat("$base_dir/$rpm"); $pkg_stat = stat('/distrib/bootstrap/distrib/cauldron/SRPMS/core/release/'.$packages[$package]); - if ($pkg_stat['mtime'] > $build_stat['mtime']) { + if (file_exists("$base_dir/$rpm") && $pkg_stat['mtime'] > $start_time) { $fixed[$rpm] = 1; } } @@ -117,9 +131,38 @@ $succes_percent = round($nb_success*1000/$nb_tried)/10; $estimated_percent = round(($nb_success+$nb_fixed)*1000/($nb_tried-$nb_removed))/10; echo "<title>$succes_percent% Success</title>\n"; -echo "</head><body>\n"; - -echo "<div style='position:absolute;right:0;top:0;'>"; +?> +<style> +.collapse-arrow:before { + content: '▼'; +} +.collapse-arrow { + text-decoration: none; +} + +.expand-arrow:before { + content: '►'; +} +.expand-arrow { + text-decoration: none; +} +</style> +<script language='javascript'> +function toggle(titleid, contentid){ + document.getElementById(titleid).classList.toggle('expand-arrow'); + document.getElementById(titleid).classList.toggle('collapse-arrow'); + var e = document.getElementById(contentid); + if(e.style.display == 'block') + e.style.display = 'none'; + else + e.style.display = 'block'; +} +</script> +<meta charset="utf-8"> +</head> +<body> +<div style='position:absolute;right:0;top:0;'> +<?php echo "<form><select name='run' onChange='document.location.href=\"".$_SERVER["PHP_SELF"]."?run=\"+this.form.run.value'>"; foreach ($runs as $r) { $in_progress = ($r > $latest) ? ' (in progress)' : ''; @@ -129,7 +172,7 @@ foreach ($runs as $r) { echo "</select></form></div>\n"; echo "<h1>$succes_percent% Success</h1>\n"; echo "$nb_fixed packages have been fixed since this run and $nb_removed have been removed.<br/> If no new package was broken, success rate next time should be $estimated_percent%.<br/>\n"; -echo "<div style='float:left'><h1>Failed builds ($nb_failed/$nb_tried):</h1><ul style='list-style:none;'>"; +echo "<div style='float:left;'><h1>Failed builds ($nb_failed/$nb_tried)</h1><ul style='list-style:none;'>"; foreach ($failure as $rpm => $error) { $parsed = parse_package($rpm); @@ -152,9 +195,13 @@ foreach ($failure as $rpm => $error) { echo "<li>$error_html $rpm $status_html $history_link</li>\n"; } } - -echo "</ul></div><div style='float:right'><h1>Successful builds ($nb_success/$nb_tried):</h1><ul>"; - +?> +</ul></div> +<div style='float:right; width:50%'><h1><a class='expand-arrow' id='success-title' href='javascript:toggle("success-title","success-list");'> +<?php echo "Successful builds ($nb_success/$nb_tried)" ?> +</a></h1> +<div id="success-list" style="display:none"><ul> +<?php foreach ($success as $rpm) { $parsed = parse_package($rpm); $history_link = '<a href="history.php?package='.$parsed['package'].'">[h]</a>'; @@ -166,6 +213,6 @@ foreach ($success as $rpm) { } ?> -</ul></div> +</ul></div></div> </body> </html> |