[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [pgstatus] [PATCH] Link to the buildd machine information from the architecture page.



There were typos in the original patch, I've attached a fix.

-- 
bye,
pabs

http://wiki.debian.org/PaulWise
From 8d6883c272618594c5eebeda4e2b005d0d453eab Mon Sep 17 00:00:00 2001
From: Paul Wise <pabs@debian.org>
Date: Sun, 26 Aug 2012 11:47:27 +0800
Subject: [PATCH] Link to the buildd machine information from the architecture
 page.

---
 architecture.php |    2 ++
 library.php      |   23 +++++++++++++++++++++++
 2 files changed, 25 insertions(+)

diff --git a/architecture.php b/architecture.php
index ec2c44d..70fa029 100644
--- a/architecture.php
+++ b/architecture.php
@@ -46,6 +46,8 @@ buildds_overview_link($arch, $suite, $buildd);
 
 notes_overview_link($arch, $suite, $notes);
 
+buildds_machine_info($arch, $suite, $buildd);
+
 echo "<p>The time indicates for how long a package is in the given state.</p>";
 
 $query =
diff --git a/library.php b/library.php
index 956f745..7708e97 100644
--- a/library.php
+++ b/library.php
@@ -590,6 +590,14 @@ function pkg_buildd($buildd, $suite, $arch) {
                  htmlentities($name));
 }
 
+function buildd_machine_link($buildd) {
+  if ($buildd == "none") return $buildd;
+  $name = buildd_name($buildd);
+  return sprintf("<a href=\"https://db.debian.org/machines.cgi?host=%s\";>%s</a>",
+                 urlencode($name),
+                 htmlentities($name));
+}
+
 function pkg_state($status, $state) {
   global $goodstate;
   if (in_array($status, $goodstate))
@@ -1186,6 +1194,21 @@ function buildds_overview_link($arch, $suite, $current_buildd="") {
   echo "<br />";
 }
 
+function buildds_machine_info($arch, $suite, $current_buildd="") {
+  $list = buildd_list($arch, $suite);
+  echo "Buildd machine info: ";
+  if (is_array($list))
+    foreach($list as $buildd) {
+      $name = $buildd["username"];
+      if ($name == "buildd_${arch}" || !is_buildd($name)) continue;
+      $name = buildd_machine_link($buildd["username"]);
+      if ($name == $current_buildd)
+        $name = "<strong>" . $name . "</strong>";
+      printf(" [%s] ", $name);
+    }
+  echo "<br />";
+}
+
 function notes_overview_link($arch, $suite, $current_notes="") {
   echo "Restrict on notes: ";
   $current_notes = empty($current_notes) ? "all" : $current_notes;
-- 
1.7.10.4

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: