diff options
Diffstat (limited to 'zarb-ml/mageia-sysadm/2011-January/001931.html')
-rw-r--r-- | zarb-ml/mageia-sysadm/2011-January/001931.html | 251 |
1 files changed, 251 insertions, 0 deletions
diff --git a/zarb-ml/mageia-sysadm/2011-January/001931.html b/zarb-ml/mageia-sysadm/2011-January/001931.html new file mode 100644 index 000000000..9d14b3968 --- /dev/null +++ b/zarb-ml/mageia-sysadm/2011-January/001931.html @@ -0,0 +1,251 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> +<HTML> + <HEAD> + <TITLE> [Mageia-sysadm] [269] Import my changes + rda's style + </TITLE> + <LINK REL="Index" HREF="index.html" > + <LINK REL="made" HREF="mailto:mageia-sysadm%40mageia.org?Subject=Re%3A%20%5BMageia-sysadm%5D%20%5B269%5D%20Import%20my%20changes%20%2B%20rda%27s%20style&In-Reply-To=%3C20110112114421.EBD68421F5%40valstar.mageia.org%3E"> + <META NAME="robots" CONTENT="index,nofollow"> + <META http-equiv="Content-Type" content="text/html; charset=us-ascii"> + <LINK REL="Previous" HREF="001930.html"> + <LINK REL="Next" HREF="001932.html"> + </HEAD> + <BODY BGCOLOR="#ffffff"> + <H1>[Mageia-sysadm] [269] Import my changes + rda's style</H1> + <B>root at mageia.org</B> + <A HREF="mailto:mageia-sysadm%40mageia.org?Subject=Re%3A%20%5BMageia-sysadm%5D%20%5B269%5D%20Import%20my%20changes%20%2B%20rda%27s%20style&In-Reply-To=%3C20110112114421.EBD68421F5%40valstar.mageia.org%3E" + TITLE="[Mageia-sysadm] [269] Import my changes + rda's style">root at mageia.org + </A><BR> + <I>Wed Jan 12 12:44:21 CET 2011</I> + <P><UL> + <LI>Previous message: <A HREF="001930.html">[Mageia-sysadm] [268] Import blino's web interface +</A></li> + <LI>Next message: <A HREF="001932.html">[Mageia-sysadm] [270] Use a subdirectory for data, to be writable by apache and fix a syntax error +</A></li> + <LI> <B>Messages sorted by:</B> + <a href="date.html#1931">[ date ]</a> + <a href="thread.html#1931">[ thread ]</a> + <a href="subject.html#1931">[ subject ]</a> + <a href="author.html#1931">[ author ]</a> + </LI> + </UL> + <HR> +<!--beginarticle--> +<PRE>Revision: 269 +Author: pterjan +Date: 2011-01-12 12:44:21 +0100 (Wed, 12 Jan 2011) +Log Message: +----------- +Import my changes + rda's style + +Modified Paths: +-------------- + build_system/web/index.php + +Modified: build_system/web/index.php +=================================================================== +--- build_system/web/index.php 2011-01-12 11:42:10 UTC (rev 268) ++++ build_system/web/index.php 2011-01-12 11:44:21 UTC (rev 269) +@@ -12,16 +12,27 @@ + + $upload_dir = "/home/schedbot/uploads"; + $max_modified = 2; +-$title = "Mageia build system"; ++$title = "Mageia build system status"; ++$tz = new DateTimeZone("UTC"); + ++# Temporary until initial mirror is ready ++$nb_rpm = shell_exec('rpm -qp --qf "%{SOURCERPM}\n" /distrib/bootstrap/distrib/cauldron/i586/media/core/release/*.rpm | sort -u | tee src.txt | wc -l'); ++$nb_rpm_mga = shell_exec('grep mga src.txt | tee src.mga.txt | wc -l'); ++shell_exec('grep -v mga src.txt > src.mdv.txt'); ++######################################### ++ + chdir($upload_dir); +-$all_files = shell_exec("find \( -name '*.rpm' -o -name '*.src.rpm.info' -o -name '*.youri' -o -name '*.lock' \) ! -ctime $max_modified"); + +-preg_match_all("!^\./(\w+)/((\w+)/(\w+)/(\w+)/(\d+)\.(\w+)\.(\w+)\.(\d+))_?(.+)(\.src\.rpm(?:\.info)?|\.youri|\.lock)$!m", $all_files, $matches, PREG_SET_ORDER); ++$all_files = shell_exec("find \( -name '*.rpm' -o -name '*.src.rpm.info' -o -name '*.youri' -o -name '*.lock' -o -name '*.done' \) ! -ctime $max_modified"); + ++preg_match_all("!^\./(\w+)/((\w+)/(\w+)/(\w+)/(\d+)\.(\w+)\.(\w+)\.(\d+))_?(.+)(\.src\.rpm(?:\.info)?|\.youri|\.lock|\.done)$!m", $all_files, $matches, PREG_SET_ORDER); ++ + $pkgs = array(); + foreach ($matches as $val) { +- $key = $val[6]; ++ if ($_GET["user"] && ($_GET["user"] != $val[7])) { ++ continue; ++ } ++ $key = $val[6] . $val[7]; + if (!is_array($pkgs[$key])) { + $pkgs[$key] = array(); + $pkgs[$key]["status"] = array(); +@@ -35,8 +46,8 @@ + } + + $status = $val[1]; +- $pkgs[$key]["status"][$status] = 1; + $data = $val[10]; ++ $pkgs[$key]["status"][$status] = $data; + $ext = $val[11]; + if ($ext == ".src.rpm.info") { + preg_match("!^(?:@\d+:)?(.*)!", $data, $name); +@@ -46,8 +57,9 @@ + } else if ($ext == ".youri") { + $pkgs[$key]["status"]["youri"] = 1; + } else if ($ext == ".lock") { ++ preg_match("/(.*)\..*\.(.*)\.\d+\.\d+/", "(\1@\2)", $data); + // parse build bot from $data +- $pkgs[$key]["status"]["build"] = 1; ++ $pkgs[$key]["status"]["build"] = $data; + } + } + // sort by key in reverse order to have more recent pkgs first +@@ -58,27 +70,33 @@ + <head> + <title><? echo $title ?></title> + <style type="text/css"> +-td.todo { +- color: black; ++table { ++ border-spacing: 0; ++ font-family: Helvetica; font-size: 80%; ++ border: 1px solid #ccc; + } +-td.building { +- color: fuchsia; +-} +-td.partial { +- color: purple; +-} +-td.built { +- color: blue; +-} +-td.youri { +- color: olive +-} +-td.uploaded { +- color: green; +-} +-td.failure, td.failure a, td.rejected, td.rejected a { +- color: red; +-} ++table tr { padding: 0; margin: 0; } ++table th { padding: 0.2em 0.5em; margin: 0; border-bottom: 2px solid #ccc; border-right: 1px solid #ccc; } ++table td { padding: 0; margin: 0; padding: 0.2em 0.5em; border-bottom: 1px solid #ccc; } ++ ++tr { background: transparent; } ++tr.uploaded { background: #ddffdd; } ++tr.failure, tr.rejected { background: #ffdddd; } ++tr.todo { background: white; } ++tr.building { background: #ffffdd; } ++tr.partial { background: blue; } ++tr.built { background: #00CCFF; } ++tr.youri { background: olive; } ++ ++td.status-box { width: 1em; height: 1em; } ++tr.uploaded td.status-box { background: green; } ++tr.failure td.status-box, tr.rejected td.status-box { background: red; } ++tr.todo td.status-box { background: white; } ++tr.building td.status-box { background: yellow; } ++tr.partial td.status-box { background: blue; } ++tr.built td.status-box { background: #00CCFF; } ++tr.youri td.status-box { background: olive; } ++ + </style> + </head> + +@@ -107,26 +125,55 @@ + return "unknown"; + } + ++function plural($num) { ++ if ($num > 1) ++ return "s"; ++} ++ ++function key2date($key) { ++ global $tz; ++ $date = DateTime::createFromFormat("YmdHis", $key+0, $tz); ++ $diff = time() - $date->getTimestamp(); ++ if ($diff<60) ++ return $diff . " second" . plural($diff) . " ago"; ++ $diff = round($diff/60); ++ if ($diff<60) ++ return $diff . " minute" . plural($diff) . " ago"; ++ $diff = round($diff/60); ++ if ($diff<24) ++ return $diff . " hour" . plural($diff) . " ago"; ++ $diff = round($diff/24); ++ return $diff . " day" . plural($diff) . " ago"; ++} ++ ++# Temporary until initial mirror is ready ++echo "<a href=\"src.mga.txt\">$nb_rpm_mga src.rpm</a> rebuilt for Mageia out of <a href=\"src.txt\">$nb_rpm</a>. <a href=\"src.mdv.txt\">List of Mandriva packages still present</a>.<br/>\n"; ++######################################### ++ ++echo "<tr><th>Submitted</th><th>User</th><th>Package</th><th>Target</th><th>Media</th><th colspan=\"2\">Status</th></tr>\n"; + foreach ($pkgs as $key => $p) { + $p["type"] = pkg_gettype(&$p); +- echo "<tr>\n"; +- echo "<td>" . $p["user"] . "</td>\n"; ++ echo "<tr class=" . $p["type"] . ">\n"; ++ echo "<td>" . key2date($key) . "</td>\n"; ++ echo "<td><a href='?user=" . $p["user"] . "'>" . $p["user"] . "</a></td>\n"; + echo "<td>" . $p["package"] . "</td>\n"; + echo "<td>" . $p["version"] . "</td>\n"; + echo "<td>" . $p["media"] . "/" . $p["section"] . "</td>\n"; ++ echo "<td class='status-box' />\n"; + $typelink = ""; + if ($p["type"] == "failure") { + $typelink = "/uploads/" . $p["type"] . "/" . $p["path"]; + } else if ($p["type"] == "rejected") { + $typelink = "/uploads/" . $p["type"] . "/" . $p["path"] . ".youri"; + } +- echo "<td class='" . $p["type"] . "'>"; ++ echo "<td>"; + if ($typelink) + echo "<a href='$typelink'>"; + echo $p["type"]; + if ($typelink) + echo "</a>"; +- echo "</td>\n";; ++ } ++ echo "</td>\n"; + echo "</tr>\n"; + } + ?> +-------------- next part -------------- +An HTML attachment was scrubbed... +URL: </pipermail/mageia-sysadm/attachments/20110112/872f6ea4/attachment-0001.html> +</PRE> + + + + + + + + + + + + +<!--endarticle--> + <HR> + <P><UL> + <!--threads--> + <LI>Previous message: <A HREF="001930.html">[Mageia-sysadm] [268] Import blino's web interface +</A></li> + <LI>Next message: <A HREF="001932.html">[Mageia-sysadm] [270] Use a subdirectory for data, to be writable by apache and fix a syntax error +</A></li> + <LI> <B>Messages sorted by:</B> + <a href="date.html#1931">[ date ]</a> + <a href="thread.html#1931">[ thread ]</a> + <a href="subject.html#1931">[ subject ]</a> + <a href="author.html#1931">[ author ]</a> + </LI> + </UL> + +<hr> +<a href="https://www.mageia.org/mailman/listinfo/mageia-sysadm">More information about the Mageia-sysadm +mailing list</a><br> +</body></html> |