From 0870cd3769db401daaeec8ceaf1fb5e7ecf1685b Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Sun, 22 Jan 2012 17:06:03 +0000 Subject: List builds in progress at the top, it is an import part of build system status --- index.php | 41 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) (limited to 'index.php') 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 = << + %s + %s + %s + %s + %s + %s/%s + +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 '
', + '', + '<', + $s, + '
', count($hosts), ' builds in progress.
MachineArchUserPackageTargetMedia
'; +echo '
'; + $s = ''; $tmpl = << -- cgit v1.2.1