summaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mageia.org>2012-01-22 17:06:03 +0000
committerPascal Terjan <pterjan@mageia.org>2012-01-22 17:06:03 +0000
commit0870cd3769db401daaeec8ceaf1fb5e7ecf1685b (patch)
treea038ff8bae3263ed85e47902d8221779a70fea5f /index.php
parente7a2acd22e9eb23cae3e998e5a6c730fbc42b3c0 (diff)
downloadpkgsubmit-0870cd3769db401daaeec8ceaf1fb5e7ecf1685b.tar
pkgsubmit-0870cd3769db401daaeec8ceaf1fb5e7ecf1685b.tar.gz
pkgsubmit-0870cd3769db401daaeec8ceaf1fb5e7ecf1685b.tar.bz2
pkgsubmit-0870cd3769db401daaeec8ceaf1fb5e7ecf1685b.tar.xz
pkgsubmit-0870cd3769db401daaeec8ceaf1fb5e7ecf1685b.zip
List builds in progress at the top, it is an import part of build system status
Diffstat (limited to 'index.php')
-rw-r--r--index.php41
1 files changed, 38 insertions, 3 deletions
diff --git a/index.php b/index.php
index 3d59b24..dba4780 100644
--- a/index.php
+++ b/index.php
@@ -129,6 +129,7 @@ $r = preg_match_all($re,
PREG_SET_ORDER);
$pkgs = array();
+$hosts = array();
$buildtime_total = array();
$buid_dates = array();
@@ -167,11 +168,15 @@ foreach ($matches as $val) {
} else if ($ext == '.upload') {
$pkgs[$key]['status']['upload'] = 1;
} else if ($ext == '.lock') {
- preg_match("!.*\.iurt\.(.*)\.\d+\.\d+!", $data, $buildhost);
+ preg_match("!(.*)\.iurt\.(.*)\.\d+\.\d+!", $data, $buildhost);
+ if (!$hosts[$buildhost[2]]) {
+ $hosts[$buildhost[2]]= array();
+ }
+ $hosts[$buildhost[2]][$buildhost[1]] = $key;
if ($pkgs[$key]['status']['build'])
- array_push($pkgs[$key]['status']['build'], $buildhost[1]);
+ array_push($pkgs[$key]['status']['build'], $buildhost[2]);
else
- $pkgs[$key]['status']['build'] = array($buildhost[1]);
+ $pkgs[$key]['status']['build'] = array($buildhost[2]);
} else if ($ext == '.done') {
// beware! this block is called twice for a given $key
@@ -312,6 +317,36 @@ if ($upload_time) {
$buildtime_stats = array();
+// Builds in progress
+$s = '';
+$tmpl = <<<TB
+<tr>
+ <td>%s</td>
+ <td>%s</td>
+ <td><a href="?user=%s">%s</a></td>
+ <td>%s</td>
+ <td>%s</td>
+ <td>%s/%s</td>
+</tr>
+TB;
+foreach ($hosts as $machine => $b) {
+ foreach ($b as $arch => $key) {
+ $s .= sprintf($tmpl,
+ $machine,
+ $arch,
+ $pkgs[$key]['user'], $pkgs[$key]['user'],
+ $pkgs[$key]['package'],
+ $pkgs[$key]['version'],
+ $pkgs[$key]['media'], $pkgs[$key]['section']);
+ }
+}
+echo '<div align="center"><table>',
+ '<caption>', count($hosts), ' builds in progress.</caption>',
+ '<tr><th>Machine</th><th>Arch</th><<th>User</th><th>Package</th><th>Target</th><th>Media</th></tr>',
+ $s,
+ '</table></div>';
+echo '<div class="clear"></div>';
+
$s = '';
$tmpl = <<<T
<tr class="%s">