/[soft]/build_system/web/autobuild/results.php
ViewVC logotype

Diff of /build_system/web/autobuild/results.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

build_system/web/autobuild/index.php revision 6877 by pterjan, Thu Dec 27 18:11:03 2012 UTC build_system/web/autobuild/results.php revision 7123 by pterjan, Wed Jan 16 23:41:40 2013 UTC
# Line 24  foreach ($runs as $r) { Line 24  foreach ($runs as $r) {
24          }          }
25          $prev = $r;          $prev = $r;
26  }  }
27    
28  $packages = Array();  $packages = Array();
29  if ($handle = opendir('/distrib/bootstrap/distrib/cauldron/SRPMS/core/release/')) {  if ($handle = opendir('/distrib/bootstrap/distrib/cauldron/SRPMS/core/release/')) {
30          while (false !== ($entry = readdir($handle))) {          while (false !== ($entry = readdir($handle))) {
31                  if (preg_match("/(.*)-([^-]*-[^-]*mga)[1-9].src.rpm/", $entry, $matches)) {                  if (preg_match("/(.*)-([^-]*-[^-]*mga)[1-9].src.rpm/", $entry, $matches)) {
32                          $packages[$matches[1]] = $matches[2];                          $packages[$matches[1]] = $entry;
33                  }                  }
34          }          }
35          closedir($handle);          closedir($handle);
# Line 56  $success = Array(); Line 57  $success = Array();
57  $failure = Array();  $failure = Array();
58  $fixed = Array();  $fixed = Array();
59  $removed = Array();  $removed = Array();
60    $broken = Array();
61    
62  $base_dir = "cauldron/x86_64/core/$run";  $base_dir = "cauldron/x86_64/core/$run";
63    
# Line 65  if (!file_exists($status_name)) { Line 67  if (!file_exists($status_name)) {
67          echo "Invalid run";          echo "Invalid run";
68          exit;          exit;
69  }  }
 $status_file = fopen($status_name, "r");  
70    
71    $stat = stat($status_name);
72    $end_time = $stat['mtime'];
73    
74    $status_file = fopen($status_name, "r");
75  while (!feof($status_file)) {  while (!feof($status_file)) {
76          $line = fgets($status_file);          $line = fgets($status_file);
77          if (preg_match("/^(.*): (.*)$/", $line, $matches)) {          if (preg_match("/^(.*): (.*)$/", $line, $matches)) {
# Line 77  while (!feof($status_file)) { Line 82  while (!feof($status_file)) {
82                  } elseif ($status != "unknown" && $status != "not_on_this_arch"){                  } elseif ($status != "unknown" && $status != "not_on_this_arch"){
83                          $failure[$rpm] = $status;                          $failure[$rpm] = $status;
84                          preg_match("/(.*)-([^-]*-[^-]*mga)[1-9].src.rpm/", $rpm, $matches);                          preg_match("/(.*)-([^-]*-[^-]*mga)[1-9].src.rpm/", $rpm, $matches);
85                          if(!$packages[$matches[1]]) {                          $package = $matches[1];
86                            $version = $matches[2];
87                            if(!$packages[$package]) {
88                                  $removed[$rpm] = 1;                                  $removed[$rpm] = 1;
89                          } elseif ($packages[$matches[1]] != $matches[2]) {                          } else {
90                                  $fixed[$rpm] = 1;                                  $stat = stat('/distrib/bootstrap/distrib/cauldron/SRPMS/core/release/'.$packages[$package]);
91                                    if ($stat['mtime'] > $end_time) {
92                                            $fixed[$rpm] = 1;
93                                    }
94                          }                          }
95                  }                  }
96          }          }
# Line 116  foreach ($runs as $r) { Line 126  foreach ($runs as $r) {
126  echo "</div>\n";  echo "</div>\n";
127  echo "<h1>$succes_percent% Success</h1>\n";  echo "<h1>$succes_percent% Success</h1>\n";
128  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";
129  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 style='list-style:none;'>";
130    
131  foreach ($failure as $rpm => $error) {  foreach ($failure as $rpm => $error) {
132          $status = "";          $status_html = "";
133          if ($fixed[$rpm]) {          if ($fixed[$rpm]) {
134                  $status = " <span style='color:green;'><b>Fixed!</b></span>";                  $status_html = " <img src='icons/state-fixed.png' title='Fixed!' />";
135          } elseif ($removed[$rpm]) {          } elseif ($removed[$rpm]) {
136                  $status = " <span style='color:yellow;'><b>Removed</b></span>";                  $status_html = " <img src='icons/state-removed.png' title='Removed' />";
137          } elseif ($prev && !$prev_failure[$rpm]) {          } elseif ($broken[$rpm]) {
138                  $status = " <span style='color:red;'><b>New!</b></span>";                  $status_html = " <img src='icons/state-new.png' title='New!' />";
139            }
140            $error_html = $error;
141            if (file_exists("icons/error-$error.png")) {
142                    $error_html = "<img src='icons/error-$error.png' title='$error'/>";
143          }          }
144          if (file_exists("$base_dir/$rpm/")) {          if (file_exists("$base_dir/$rpm/")) {
145                  echo "<li><a href='$base_dir/$rpm/'>$rpm</a> $error $status</li>\n";                  echo "<li>$error_html <a href='$base_dir/$rpm/'>$rpm</a> $status_html</li>\n";
146          } else {          } else {
147                  echo "<li>$rpm $error $status</li>\n";                  echo "<li>$error_html $rpm $status_html</li>\n";
148          }          }
149  }  }
150    
151  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>";
152    
153  foreach ($success as $rpm) {  foreach ($success as $rpm) {
154          echo "<li><a href='$base_dir/$rpm/'>$rpm</a></li>\n";          if (file_exists("$base_dir/$rpm/")) {
155                    echo "<li><a href='$base_dir/$rpm/'>$rpm</a></li>\n";
156            } else {
157                    echo "<li>$rpm</li>\n";
158            }
159  }  }
160    
161  ?>  ?>

Legend:
Removed from v.6877  
changed lines
  Added in v.7123

  ViewVC Help
Powered by ViewVC 1.1.30