<?php
-$buildlogs_server = "buildlogs.pld.org.pl";
+$buildlogs_server = "buildlogs.pld-linux.org";
$url = "index.php";
$addr = array(
- "/nest/athlon",
- "/nest/i386",
- "/nest/i586",
- "/nest/i686",
- "/nest/ppc",
+ "/th/SRPMS",
+ "/th/i486",
+ "/th/i686",
+ "/th/athlon",
+ "/th/x86_64",
+ "/th/ia64",
+ "/th/alpha",
+ "/th/ppc",
+ "/th/sparc",
+ "/ac/SRPMS",
+ "/ac/i386",
+ "/ac/i586",
+ "/ac/i686",
+ "/ac/athlon",
+ "/ac/amd64",
+ "/ac/alpha",
+ "/ac/ppc",
+ "/ac/sparc",
+ "/ac/sparc64"/*,
"/ra/i386",
"/ra/i586",
"/ra/i686",
- "/ra/alpha",
+ "/ra/alpha",
+ "/ra/ppc",
"/ra/sparc",
- "/ra/ppc"
+ "/nest/i486",
+ "/nest/i686",
+ "/nest/alpha",
+ "/nest/ppc"
+*/
);
-$qa_base = "http://ftp.pld.org.pl/.stat/builder";
$qa_addr = array(
- "",
- "/kenny/rpmqa-nest-i386.txt",
- "/kenny/rpmqa-nest-i586.txt",
- "/kenny/rpmqa-nest-i686.txt",
- "",
- "/ep/rpmqa-ra-i386.txt",
- "/ep/rpmqa-ra-i586.txt",
- "/ep/rpmqa-ra-i686.txt",
- "/mifgate/rpmqa-ra-alpha.txt",
- "/team/rpmqa-ra-sparc.txt",
- ""
+ "http://ftp.pld-linux.org/dists/th/.stat/builder/th/rpmqa-SRPMS.txt",
+ "http://ftp.pld-linux.org/dists/th/.stat/builder/th/rpmqa-i486.txt",
+ "http://ftp.pld-linux.org/dists/th/.stat/builder/th/rpmqa-i686.txt",
+ "http://ftp.pld-linux.org/dists/th/.stat/builder/th/rpmqa-athlon.txt",
+ "http://ftp.pld-linux.org/dists/th/.stat/builder/th/rpmqa-x86_64.txt",
+ "http://ftp.pld-linux.org/dists/th/.stat/builder/th/rpmqa-ia64.txt",
+ "http://ftp.pld-linux.org/dists/th/.stat/builder/th/rpmqa-alpha.txt",
+ "http://ftp.pld-linux.org/dists/th/.stat/builder/th/rpmqa-ppc.txt",
+ "http://ftp.pld-linux.org/dists/th/.stat/builder/th/rpmqa-sparc.txt",
+ "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-SRPMS.txt",
+ "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-i386.txt",
+ "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-i586.txt",
+ "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-i686.txt",
+ "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-athlon.txt",
+ "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-amd64.txt",
+ "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-alpha.txt",
+ "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-ppc.txt",
+ "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-sparc.txt",
+ "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-sparc64.txt"/*,
+ "http://ftp.pld-linux.org/dists/ra/.stat/builder/liniowiec/rpmqa-ra-i386.txt",
+ "http://ftp.pld-linux.org/dists/ra/.stat/builder/liniowiec/rpmqa-ra-i586.txt",
+ "http://ftp.pld-linux.org/dists/ra/.stat/builder/liniowiec/rpmqa-ra-i686.txt",
+ "http://ftp.pld-linux.org/dists/ra/.stat/builder/fly/rpmqa-ra-alpha.txt",
+ "http://ftp.pld-linux.org/dists/ra/.stat/builder/an2/rpmqa-ra-ppc.txt",
+ "http://ftp.pld-linux.org/dists/ra/.stat/builder/ares/rpmqa-ra-sparc.txt",
+ "http://ftp.nest.pld-linux.org/.stat/builder/kenny/rpmqa-nest-i486.txt",
+ "http://ftp.nest.pld-linux.org/.stat/builder/kenny/rpmqa-nest-i686.txt",
+ "http://ftp.nest.pld-linux.org/.stat/builder/alpha/rpmqa-nest-alpha.txt",
+ "http://ftp.nest.pld-linux.org/.stat/builder/an2/rpmqa-nest-ppc.txt"
+*/
);
$local = 1; /* $local=0 for FTP */
-$root_directory = "/home/services/ftp/pub/logs";
+$root_directory = "/home/services/ftp/pub/pld-buildlogs";
$ftp_conn = 0;
/* It should be set */
textdomain("messages");
if (isset($_GET["idx"]))$idx=$_GET["idx"];
+if (isset($_GET["dist"]))
+{
+ $dist=$_GET["dist"];
+ if (isset($_GET["arch"]))
+ {
+ $arch=$_GET["arch"];
+ for ($i = 0; $i < count($addr); $i++)
+ {
+ if ($addr[$i]=="/".$dist."/".$arch)
+ $idx=$i;
+ }
+ }
+}
if (isset($_GET["ok"]))$ok=$_GET["ok"];
+else $ok="";
if (isset($_GET["ns"]))$ns=$_GET["ns"];
+else $ns="";
if (isset($_GET["cnt"]))$cnt=$_GET["cnt"];
if (isset($_GET["action"]))$action=$_GET["action"];
+else $action="";
if (isset($_GET["off"]))$off=$_GET["off"];
if (isset($_GET["id"]))$id=$_GET["id"];
function start_pre()
{
echo "<table cellpadding=\"10\"><tr><td bgcolor=\"#000000\">".
- "<font color=\"#cccccc\"><pre>";
+ "<font color=\"#cccccc\"><pre style=\"width: 2048px;overflow: scroll\">";
}
function end_pre()
}
if (ftp_login($ftp, "anonymous",
- "buildlogs-iface@pld.org.pl") == false) {
+ "buildlogs-iface@pld-linux.org") == false) {
ftp_quit($ftp);
mydie(_("cannot ftp login to")." $buildlogs_server");
return false;
$dir = opendir("$root_directory$a");
$i = 0;
+ $list = array ();
while ($file = readdir($dir)) {
if (($file != ".") && ($file != "..")) {
- $list[$i] = "$a/$file";
+ $list[$i] = array("$a/$file", filemtime("$root_directory$a/$file"));
$i++;
}
}
if ($ok == 1) {
echo "<h1>"._("Listing of")." $addr[$idx]/OK "
- ."(<a href=\"$big_url&ok=0\">"._("fail")."</a>)</h1>";
+ ."(<a href=\"$big_url&ok=0\">"._("fail")."</a>)</h1>\n";
} else {
echo "<h1>"._("Listing of")." $addr[$idx]/FAIL "
- ."(<a href=\"$big_url&ok=1\">"._("ok")."</a>)</h1>";
+ ."(<a href=\"$big_url&ok=1\">"._("ok")."</a>)</h1>\n";
}
- echo "<div align=\"center\"><table border=\"0\" cellspacing=\"1\" ".
+ echo "<div align=\"center\"><table cols=\"4\" border=\"0\" cellspacing=\"1\" ".
"cellpadding=\"3\" bgcolor=\"#000000\" width=\"90%\">\n";
- echo "<tr><th bgcolor=\"#CCCCFF\" align=\"left\" width=\"60%\">"._("Log File").
+ echo "<tr><th bgcolor=\"#CCCCFF\" align=\"right\" width=\"1%\">"._("No.")."</th>".
+ "<th bgcolor=\"#CCCCFF\" align=\"left\" width=\"80%\">"._("Log File").
"[<a href=\"$big_url&ns=1\">"._("sort")."</a>]</th>".
- "<th bgcolor=\"#CCCCFF\" align=\"right\" width=\"15%\">"._("Size")."</th> ".
+ "<th bgcolor=\"#CCCCFF\" align=\"right\" width=\"15%\">"._("Size")."</th> ".
"<th bgcolor=\"#CCCCFF\" align=\"left\">"._("Age").
"[<a href=\"$big_url&ns=0\">"._("sort")."</a>]</th>".
- "</th></tr>";
+ "</tr>";
function cmp($f1, $f2) {
global $ftp_conn, $root_directory, $local;
if ($local)
- return filemtime("$root_directory$f2") - filemtime("$root_directory$f1");
+ return $f2[1] - $f1[1];//filemtime("$root_directory$f2") - filemtime("$root_directory$f1");
return ftp_mdtm($ftp_conn, $f2) - ftp_mdtm($ftp_conn, $f1);
}
+ function cmp2($f1, $f2) {
+ return strcmp($f1[0], $f2[0]);
+ }
+
if ($ns != 1) {
$ns = 0;
- usort($list, cmp);
+ usort($list, "cmp");
} else {
- sort($list);
+ usort($list, "cmp2");
}
$now = time();
for ($i = $off; $i < $cnt + $off; $i++) {
- if (!isset($list[$i]))
+ $filename = $list[$i][0];
+ if (!isset($filename))
continue;
- $h = bin2hex(mhash(MHASH_MD5, $list[$i]));
- $f = preg_replace("/.*\/([^\/]*)$/", "\\1", $list[$i]);
+ $h = bin2hex(mhash(MHASH_MD5, $filename));
+ $f = preg_replace("/.*\/([^\/]*)$/", "\\1", $filename);
$f = preg_replace("/\.(bz2|gz)$/", "", $f);
if ($local) {
- $s = filesize("$root_directory$list[$i]");
- $t = $now - filemtime("$root_directory$list[$i]");
+ $s = filesize("$root_directory$filename");
+ $t = $now - $list[$i][1];
} else {
$s = ftp_size($ftp_conn, $list[$i]);
$t = $now - ftp_mdtm($ftp_conn, $list[$i]);
if ($t >= 24) {
$t /= 24;
$t = round($t);
- $t = $t . ngettext(" day"," days",$t);
+ $t = $t . " " . ngettext("day","days",$t);
} else {
$t = round($t);
- $t = $t . ngettext(" hour"," hours",$t);
+ $t = $t . " " . ngettext("hour","hours",$t);
}
} else {
$t = round($t);
- $t = $t . ngettext(" minute"," minutes",$t);
+ $t = $t . " " . ngettext("minute","minutes",$t);
}
$u = "$big_url&off=$off&id=$h";
- echo "<tr><td bgcolor=\"#CCCCCC\"><a href=\"$u\">".
- "$f</a> ".
+ echo "<tr><td bgcolor=\"#CCCCCC\" align=\"right\">".($i+1).".</td>".
+ "<td bgcolor=\"#CCCCCC\"><a href=\"$u\">$f</a> ".
"[<a href=\"$u&action=text\">"._("text")."</a> | ".
"<a href=\"$u&action=tail\">"._("tail")."</a>]".
"</td><td bgcolor=\"#CCCCCC\" align=\"right\">".
$f = false;
for ($i = 0; $i < count($list); $i++) {
- $h = bin2hex(mhash(MHASH_MD5, $list[$i]));
+ $h = bin2hex(mhash(MHASH_MD5, $list[$i][0]));
if ($h == $id) {
- $f = $list[$i];
+ $f = $list[$i][0];
}
}
}
one_item(_("Status"), ($ok == 1 ?
- "<font color=green><b>"._("OK")."</b></font>" :
- "<font color=red><b>"._("Failed")."</b></a>"));
+ "<font color=\"green\"><b>"._("OK")."</b></font>" :
+ "<font color=\"red\"><b>"._("Failed")."</b></a>"));
one_item(_("Source URL"),
href("ftp://$buildlogs_server$f",
"ftp://$buildlogs_server$f"));
$cmd = "$cmd | tail -n 100";
$fd = popen($cmd, "r");
start_pre();
- while (($s = fgets($fd, 1000)) != false) {
+ while (($s = fgets($fd, 102400)) != false) {
+ if (strlen($s) > 800) {
+ $s = chunk_split($s, 800, "\n ");
+ $s = trim($s);
+ }
$s = htmlspecialchars($s);
echo $s;
}
function list_archs()
{
- global $addr, $url, $idx, $cnt;
+ global $addr, $url, $idx, $cnt,$ok,$ns;
if (!isset($cnt))
$cnt = 16;
echo "<a href=\"$big_url&action=adv_search\">"._("Advanced Search")."</a><br />\n";
echo "<a href=\"$url\">main()</a><hr />\n";
- echo "<a href=\"http://www.pld.org.pl/\"><img src=\"powpld.png\" ".
+ echo "<a href=\"http://www.pld-linux.org/\"><img src=\"powpld.png\" ".
"alt=\""._("Powered by PLD Linux")."\" border=\"0\" /></a><br />\n" .
"<small>(c) 2002 ".
- "<a href=\"mailto:feedback@pld.org.pl\">PLD Team</a>\n".
+ "<a href=\"mailto:feedback@pld-linux.org\">PLD Team</a><br />\n".
+ '$Revision: 1.88 $'.
"</small></div>\n";
# smile ;)
"Real Operating System", "Real Computer",
"computron", "bogon", "quantum bogodynamics",
"BOFH", "/dev/ill", "nasi tu byli",
- "Paranoid Android", "Lunatic Corp"
+ "Paranoid Android", "Lunatic Corp", "Parallel thinking",
+ "sfistak", "Linus", "The Golden Path", "Dark Side of the Force",
+ "Przewodniczacego Lepper-a", "KDE", "Microsoft Windows 2003"
# feel free to add sth if you change this file ;)
);
echo _("Powered by")." ";
global $qa_addr;
- if ($qa_addr[$idx] != "") {
+ if (isset($qa_addr[$idx]) && $qa_addr[$idx] != "") {
echo "<form action=\"index.php\" method=\"post\">";
- echo "<input type=hidden name=idx value=$idx />";
- echo "<input type=hidden name=action value=sqa />";
- echo "<input type=text size=14 name=str /><br />";
- echo "<input type=submit name=submit value=\""._("Search rpmqa!")."\" />";
+ echo "<input type=\"hidden\" name=\"idx\" value=\"$idx\" />";
+ echo "<input type=\"hidden\" name=\"action\" value=\"sqa\" />";
+ echo "<input type=\"text\" size=\"14\" name=\"str\" /><br />";
+ echo "<input type=\"submit\" name=\"submit\" value=\""._("Search rpmqa!")."\" />";
echo "</form>";
}
}
function get_qa()
{
- global $idx, $qa_addr, $qa_base;
+ global $idx, $qa_addr;
if (!isset($idx) || !isset($qa_addr[$idx]))
return false;
if ($qa_addr[$idx] == "")
return false;
else
- return fopen("$qa_base$qa_addr[$idx]", "r");
+ return fopen("$qa_addr[$idx]", "r");
}
function search_qa()
$big_url = "$url?idx=$idx&ok=$ok&ns=$ns&cnt=$cnt";
+ echo "<script><!--\n".
+ "function checkboxToggle() {\n".
+ "for (var i=0;i<document.forms[0].elements.length;i++) {\n".
+ "var e = document.forms[0].elements[i];\n".
+ "if ((e.name != 'all') && (e.type=='checkbox'))\n".
+ "e.checked = document.forms[0].all.checked;\n".
+ "}\n }\n -->\n </script>\n";
+
echo "<form action=\"index.php?action=adv_search\" method=\"post\">";
echo "<div align=\"center\">";
echo "<table border=\"0\">\n";
echo "<tr>\n";
echo "<td>"._("Package name")."</td>\n";
- echo "<td><input type=\"text\" size=\"20\" name=\"name\" value=\"".$_POST[name]."\"/></td>\n";
+ echo "<td><input type=\"text\" size=\"20\" name=\"name\" value=\"".$_POST["name"]."\"/></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<tr>\n";
$name="as0_".$i;
$check=" checked=\"on\"";
- echo "<td><input name=$name type=\"checkbox\"$check>".$addr[$i]."</input></td>\n";
+ echo "<td><input name=\"$name\" id=\"$name\" type=\"checkbox\"$check /><label for=\"$name\">".$addr[$i]."</label></td>\n";
$name="as1_".$i;
$check=" checked=\"on\"";
- echo "<td><input name=$name type=\"checkbox\"$check>".$addr[$i]."</input></td>\n";
+ echo "<td><input name=\"$name\" id=\"$name\" type=\"checkbox\"$check /><label for=\"$name\">".$addr[$i]."</label></td>\n";
echo "</tr>\n";
}
echo "<tr>\n";
- echo "<td><input type=submit name=submit value=\""._("Search!")."\" /></td>";
+ echo "<td><input name=\"all\" type=\"checkbox\" checked=\"on\" onClick=\"checkboxToggle()\">"._("Toggle checkboxes")." <input type=\"submit\" name=\"submit\" value=\""._("Search!")."\" /></td>";
echo "</tr>\n";
echo "</table>\n";
{
while (list($k,$name)=each($tmp_list))
{
- $s = filesize("$root_directory$name");
- $t = $now - filemtime("$root_directory$name");
+ $s = filesize("$root_directory$name[0]");
+ $t = $now - $name[1];
$t/=(24*3600);
- if (($_POST["name"]!="") && (!preg_match("/".$_POST["name"]."/i",$name)))continue;
+ if (($_POST["name"]!="") && (!preg_match("/".$_POST["name"]."/i",$name[0])))continue;
if (($_POST["age1"]) && ($_POST["age1"]>$t))continue;
if (($_POST["age2"]) && ($_POST["age2"]<$t))continue;
function cmp1($f1, $f2) {
global $ftp_conn, $root_directory, $local;
if ($local)
- return filemtime("$root_directory$f2") - filemtime("$root_directory$f1");
+ return $f2[1] - $f1[1];
return ftp_mdtm($ftp_conn, $f2) - ftp_mdtm($ftp_conn, $f1);
}
function cmp2($f1, $f2) {
- list($p11,$p12,$p13)=explode("_",$f1);
- list($p21,$p22,$p23)=explode("_",$f2);
- return strcmp($f2,$f1);
+ list($p11,$p12,$p13)=explode("_",$f1[0]);
+ list($p21,$p22,$p23)=explode("_",$f2[0]);
+ return strcmp($f1[0],$f2[0]);
}
if ($ns == 1)
$counter++;
list($i,$j,$k)=explode("_",$k);
+ $filename = $name[0];
- $h = bin2hex(mhash(MHASH_MD5, $name));
- $f = preg_replace("/.*\/([^\/]*)$/", "\\1", $name);
+ $h = bin2hex(mhash(MHASH_MD5, $filename));
+ $f = preg_replace("/.*\/([^\/]*)$/", "\\1", $filename);
$f = preg_replace("/\.(bz2|gz)$/", "", $f);
if ($local) {
- $s = filesize("$root_directory$name");
- $t = $now - filemtime("$root_directory$name");
+ $s = filesize("$root_directory$filename");
+ $t = $now - $name[1];
} else {
$s = ftp_size($ftp_conn, $list[$i]);
$t = $now - ftp_mdtm($ftp_conn, $list[$i]);
if ($t >= 24) {
$t /= 24;
$t = round($t);
- $t = $t . ngettext(" day"," days",$t);
+ $t = $t . " " . ngettext("day","days",$t);
} else {
$t = round($t);
- $t = $t . ngettext(" hour"," hours",$t);
+ $t = $t . " " . ngettext("hour","hours",$t);
}
} else {
$t = round($t);
- $t = $t . ngettext(" minute"," minutes",$t);
+ $t = $t . " " . ngettext("minute","minutes",$t);
}
$big_url = "$url?idx=$i&ok=$j&ns=$ns&cnt=$cnt";
$u = "$big_url&off=$off&id=$h";
$builder=$addr[$i]."/".(($j=="1")?"OK":"FAIL");
echo "<tr>";
- echo "<td bgcolor=#CCCCCC><a href=\"$u\">$builder</a></td>";
- echo "<td bgcolor=#CCCCCC><a href=\"$u\">$f</a> ".
+ echo "<td bgcolor=\"#CCCCCC\"><a href=\"$u\">$builder</a></td>";
+ echo "<td bgcolor=\"#CCCCCC\"><a href=\"$u\">$f</a> ".
"[<a href=\"$u&action=text\">"._("text")."</a> | ".
"<a href=\"$u&action=tail\">"._("tail")."</a>]".
- "</td><td bgcolor=#CCCCCC align=right>".
- "$s</td><td bgcolor=#CCCCCC>$t</td></tr>\n";
+ "</td><td bgcolor=\"#CCCCCC\" align=\"right\">".
+ "$s</td><td bgcolor=\"#CCCCCC\">$t</td></tr>\n";
}
echo "</table></div>\n";
<p><?=_("Welcome to PLD Build Logs WWW interface.")?></p><p>
<?=_("Feel free to email bug reports, complaints and feature requests ")?>
<!-- ech... niech strace... -->
-<a href="mailto:feedback@pld.org.pl"><?=_("to us")?></a>. <?=_("Positive opinions are also")?>
-<a href="mailto:feedback@pld.org.pl"><?=_("welcome")?></a> ;)</p>
-<p>Version: $Id: index.php,v 1.43 2002/10/12 07:48:30 juandon Exp $</p>
+<a href="mailto:feedback@pld-linux.org"><?=_("to us")?></a>. <?=_("Positive opinions are also")?>
+<a href="mailto:feedback@pld-linux.org"><?=_("welcome")?></a> ;)</p>
+<p>Version: $Id: index.php,v 1.88 2006/09/15 18:16:37 witekfl Exp $</p>
</td><td width="20%"> </td></tr>
</table>
<?php