summaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mageia.org>2012-01-25 22:36:16 +0000
committerPascal Terjan <pterjan@mageia.org>2012-01-25 22:36:16 +0000
commit251daf9fbcf0fe1ddcabff38bedf6a41d8039a66 (patch)
treeed2264734e45d36be72aa02a3978b78efd2ebd37 /index.php
parent95f60a0e455c2fa3218a7a1dfc904192d35dc2a0 (diff)
downloadpkgsubmit-251daf9fbcf0fe1ddcabff38bedf6a41d8039a66.tar
pkgsubmit-251daf9fbcf0fe1ddcabff38bedf6a41d8039a66.tar.gz
pkgsubmit-251daf9fbcf0fe1ddcabff38bedf6a41d8039a66.tar.bz2
pkgsubmit-251daf9fbcf0fe1ddcabff38bedf6a41d8039a66.tar.xz
pkgsubmit-251daf9fbcf0fe1ddcabff38bedf6a41d8039a66.zip
Allow restricting to a package name, and getting the status of last build in a header
Diffstat (limited to 'index.php')
-rw-r--r--index.php25
1 files changed, 24 insertions, 1 deletions
diff --git a/index.php b/index.php
index ab16c01..9d948ca 100644
--- a/index.php
+++ b/index.php
@@ -194,6 +194,17 @@ foreach ($matches as $val) {
}
}
}
+
+// filter packages if a package name was provided
+if ($_GET['package']) {
+ foreach ($pkgs as $key => $pkg) {
+ preg_match("/^(.*)-[^-]*-[^-]*$/", $pkg['package'], $name);
+ if ($_GET['package'] != $name[1]) {
+ unset($pkgs[$key]);
+ }
+ }
+}
+
// sort by key in reverse order to have more recent pkgs first
krsort($pkgs);
ksort($build_dates);
@@ -235,6 +246,7 @@ if ($stat) {
}
// publish stats as headers
+
foreach ($stats as $k => $v) {
Header("X-BS-Queue-$k: $v");
}
@@ -245,6 +257,12 @@ if($w < 0)
$w = $w * 60;
Header("X-BS-Throttle: $w");
+if ($_GET['last'] && $total > 0) {
+ reset($pkgs);
+ $last = current($pkgs);
+ Header("X-BS-Package-Status: ".$last['type']);
+}
+
$buildtime_total = $buildtime_total / 60;
header(sprintf('X-BS-Buildtime: %d', round($buildtime_total)));
$buildtime_avg = round($buildtime_total / $build_count, 2);
@@ -298,9 +316,11 @@ header(sprintf('X-BS-Buildtime-Average: %5.2f', $buildtime_avg));
<h1><?php echo $title ?></h1>
<?php
-if (!is_null($g_user))
+if (!is_null($g_user) || $_GET['package'])
echo '<a href="/">&laquo;&nbsp;Back to full list</a>';
+if (!$_GET['package']) {
+
# Temporary until initial mirror is ready
echo sprintf(
'<p><a href="%s">%s broken dependencies</a>. <a href="%s">%s unmaintained packages</a>. <strong><a href="%s">You can help!</a></strong></p>',
@@ -347,6 +367,9 @@ echo '<div align="center"><table>',
'</table></div>';
echo '<div class="clear"></div>';
+}
+
+// Build queue
$s = '';
$tmpl = <<<T
<tr class="%s">