2 |
<head> |
<head> |
3 |
<?php |
<?php |
4 |
|
|
5 |
$success = Array(); |
$runs = Array(); |
6 |
$failure = Array(); |
$handle = opendir('cauldron/x86_64/core/'); |
7 |
$fixed = Array(); |
while (false !== ($entry = readdir($handle))) { |
8 |
$removed = Array(); |
if (preg_match("/^....-..-..$/", $entry, $matches)) { |
9 |
$packages = Array(); |
array_push($runs, $matches[0]); |
10 |
|
} |
11 |
|
} |
12 |
|
closedir($handle); |
13 |
|
sort($runs); |
14 |
|
|
15 |
|
$latest = readlink("cauldron/x86_64/core/latest"); |
16 |
$run = $_GET['run']; |
$run = $_GET['run']; |
17 |
if (!$run) { |
if (!$run) { |
18 |
$run = "latest"; |
$run = $latest; |
19 |
} |
} |
|
$base_dir = "cauldron/x86_64/core/$run"; |
|
|
|
|
|
$status_name = "$base_dir/status.core.log"; |
|
|
$status_file = fopen($status_name, "r"); |
|
20 |
|
|
21 |
|
foreach ($runs as $r) { |
22 |
|
if ($r==$run) { |
23 |
|
break; |
24 |
|
} |
25 |
|
$prev = $r; |
26 |
|
} |
27 |
|
$packages = Array(); |
28 |
if ($handle = opendir('/distrib/bootstrap/distrib/cauldron/SRPMS/core/release/')) { |
if ($handle = opendir('/distrib/bootstrap/distrib/cauldron/SRPMS/core/release/')) { |
29 |
while (false !== ($entry = readdir($handle))) { |
while (false !== ($entry = readdir($handle))) { |
30 |
if (preg_match("/(.*)-([^-]*-[^-]*mga)[1-9].src.rpm/", $entry, $matches)) { |
if (preg_match("/(.*)-([^-]*-[^-]*mga)[1-9].src.rpm/", $entry, $matches)) { |
34 |
closedir($handle); |
closedir($handle); |
35 |
} |
} |
36 |
|
|
37 |
|
$prev_failure = Array(); |
38 |
|
if ($prev) { |
39 |
|
$base_dir = "cauldron/x86_64/core/$prev"; |
40 |
|
$status_name = "$base_dir/status.core.log"; |
41 |
|
$status_file = fopen($status_name, "r"); |
42 |
|
while (!feof($status_file)) { |
43 |
|
$line = fgets($status_file); |
44 |
|
if (preg_match("/^(.*): (.*)$/", $line, $matches)) { |
45 |
|
$rpm = $matches[1]; |
46 |
|
$status = $matches[2]; |
47 |
|
if ($status != "ok" && $status != "unknown" && $status != "not_on_this_arch") { |
48 |
|
$prev_failure[$rpm] = 1; |
49 |
|
} |
50 |
|
} |
51 |
|
} |
52 |
|
fclose($status_file); |
53 |
|
} |
54 |
|
|
55 |
|
$success = Array(); |
56 |
|
$failure = Array(); |
57 |
|
$fixed = Array(); |
58 |
|
$removed = Array(); |
59 |
|
|
60 |
|
$base_dir = "cauldron/x86_64/core/$run"; |
61 |
|
|
62 |
|
|
63 |
|
$status_name = "$base_dir/status.core.log"; |
64 |
|
if (!file_exists($status_name)) { |
65 |
|
echo "Invalid run"; |
66 |
|
exit; |
67 |
|
} |
68 |
|
$status_file = fopen($status_name, "r"); |
69 |
|
|
70 |
while (!feof($status_file)) { |
while (!feof($status_file)) { |
71 |
$line = fgets($status_file); |
$line = fgets($status_file); |
72 |
if (preg_match("/^(.*): (.*)$/", $line, $matches)) { |
if (preg_match("/^(.*): (.*)$/", $line, $matches)) { |
75 |
if ($status == "ok") { |
if ($status == "ok") { |
76 |
array_push($success, $rpm); |
array_push($success, $rpm); |
77 |
} elseif ($status != "unknown" && $status != "not_on_this_arch"){ |
} elseif ($status != "unknown" && $status != "not_on_this_arch"){ |
78 |
array_push($failure, $rpm); |
$failure[$rpm] = $status; |
79 |
preg_match("/(.*)-([^-]*-[^-]*mga)[1-9].src.rpm/", $rpm, $matches); |
preg_match("/(.*)-([^-]*-[^-]*mga)[1-9].src.rpm/", $rpm, $matches); |
80 |
if(!$packages[$matches[1]]) { |
if(!$packages[$matches[1]]) { |
81 |
$removed[$rpm] = 1; |
$removed[$rpm] = 1; |
87 |
} |
} |
88 |
fclose($status_file); |
fclose($status_file); |
89 |
|
|
90 |
|
sort($success); |
91 |
|
ksort($failure); |
92 |
|
|
93 |
$nb_failed = count($failure); |
$nb_failed = count($failure); |
94 |
$nb_success = count($success); |
$nb_success = count($success); |
95 |
$nb_fixed = count($fixed); |
$nb_fixed = count($fixed); |
101 |
echo "<title>$succes_percent% Success</title>\n"; |
echo "<title>$succes_percent% Success</title>\n"; |
102 |
echo "</head><body>\n"; |
echo "</head><body>\n"; |
103 |
|
|
104 |
|
echo "<div style='position:absolute;right:0;top:0;'>"; |
105 |
|
foreach ($runs as $r) { |
106 |
|
$text = $r . (($r > $latest) ? ' (in progress)' : ''); |
107 |
|
|
108 |
|
if ($r==$run) { |
109 |
|
echo $text; |
110 |
|
} else { |
111 |
|
echo '<a href="'.$_SERVER["PHP_SELF"].'?run='.$r.'">'.$text.'</a>'; |
112 |
|
} |
113 |
|
echo ' '; |
114 |
|
} |
115 |
|
|
116 |
|
echo "</div>\n"; |
117 |
echo "<h1>$succes_percent% Success</h1>\n"; |
echo "<h1>$succes_percent% Success</h1>\n"; |
118 |
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 "$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"; |
119 |
echo "<div style='float:left'><h1>Failed builds ($nb_failed/$nb_tried):</h1><ul>"; |
echo "<div style='float:left'><h1>Failed builds ($nb_failed/$nb_tried):</h1><ul>"; |
120 |
|
|
121 |
foreach ($failure as $rpm) { |
foreach ($failure as $rpm => $error) { |
122 |
$status = ""; |
$status = ""; |
123 |
if ($fixed[$rpm]) { |
if ($fixed[$rpm]) { |
124 |
$status = " <span style='color:green;'><b>Fixed!</b></span>"; |
$status = " <span style='color:green;'><b>Fixed!</b></span>"; |
125 |
} elseif ($removed[$rpm]) { |
} elseif ($removed[$rpm]) { |
126 |
$status = " <span style='color:yellow;'><b>Removed</b></span>"; |
$status = " <span style='color:yellow;'><b>Removed</b></span>"; |
127 |
|
} elseif ($prev && !$prev_failure[$rpm]) { |
128 |
|
$status = " <span style='color:red;'><b>New!</b></span>"; |
129 |
|
} |
130 |
|
if (file_exists("$base_dir/$rpm/")) { |
131 |
|
echo "<li><a href='$base_dir/$rpm/'>$rpm</a> $error $status</li>\n"; |
132 |
|
} else { |
133 |
|
echo "<li>$rpm $error $status</li>\n"; |
134 |
} |
} |
|
echo "<li><a href='$base_dir/$rpm/'>$rpm</a>$status</li>\n"; |
|
135 |
} |
} |
136 |
|
|
137 |
echo "</ul></div><div style='float:right'><h1>Successful builds ($nb_success/$nb_tried):</h1><ul>"; |
echo "</ul></div><div style='float:right'><h1>Successful builds ($nb_success/$nb_tried):</h1><ul>"; |