2 $buildlogs_server = "buildlogs.pld-linux.org";
28 "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-SRPMS.txt",
29 "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-i386.txt",
30 "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-i586.txt",
31 "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-i686.txt",
32 "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-athlon.txt",
33 "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-amd64.txt",
34 "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-ia64.txt",
35 "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-alpha.txt",
36 "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-sparc.txt",
37 "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-ppc.txt",
38 "http://ftp.pld-linux.org/dists/ra/.stat/builder/liniowiec/rpmqa-ra-i386.txt",
39 "http://ftp.pld-linux.org/dists/ra/.stat/builder/liniowiec/rpmqa-ra-i586.txt",
40 "http://ftp.pld-linux.org/dists/ra/.stat/builder/liniowiec/rpmqa-ra-i686.txt",
41 "http://ftp.pld-linux.org/dists/ra/.stat/builder/fly/rpmqa-ra-alpha.txt",
42 "http://ftp.pld-linux.org/dists/ra/.stat/builder/ares/rpmqa-ra-sparc.txt",
43 "http://ftp.pld-linux.org/dists/ra/.stat/builder/an2/rpmqa-ra-ppc.txt",
44 "http://ftp.nest.pld-linux.org/.stat/builder/kenny/rpmqa-nest-i386.txt",
45 "http://ftp.nest.pld-linux.org/.stat/builder/kenny/rpmqa-nest-i686.txt",
47 "http://ftp.nest.pld-linux.org/.stat/builder/alpha/rpmqa-nest-alpha.txt",
48 "http://ftp.nest.pld-linux.org/.stat/builder/an2/rpmqa-nest-ppc.txt"
50 $local = 1; /* $local=0 for FTP */
51 $root_directory = "/home/services/ftp/pub/pld-buildlogs";
53 /* It should be set */
55 $langs["en_US"]["charset"]="ISO-8859-1";
56 $langs["pl_PL"]["charset"]="ISO-8859-2";
59 if (isset($_SERVER["HTTP_ACCEPT_LANGUAGE"]))
61 $rows=explode(";",$_SERVER["HTTP_ACCEPT_LANGUAGE"]);
62 $rows=explode(",",$rows[0]);
63 $lang_detected=rtrim($rows[0]);
64 } else if (preg_match("/opera/i",$_SERVER["HTTP_USER_AGENT"]))
66 $lang_detected=preg_replace("/.*\[(.*)\].*/i","\\1",$_SERVER["HTTP_USER_AGENT"]);
70 $lang_detected=preg_replace("/^pl$/i","pl_PL",$lang_detected);
72 if (isset($lang_detected) && isset($langs[$lang_detected]))
77 if (isset($_GET["lang"]))$_SESSION["lang"]=$_GET["lang"];
78 if (isset($_SESSION["lang"]))$lang=$_SESSION["lang"];
81 setlocale(LC_ALL,$lang);
82 bindtextdomain("messages","locale");
83 textdomain("messages");
85 if (isset($_GET["idx"]))$idx=$_GET["idx"];
86 if (isset($_GET["ok"]))$ok=$_GET["ok"];
88 if (isset($_GET["ns"]))$ns=$_GET["ns"];
90 if (isset($_GET["cnt"]))$cnt=$_GET["cnt"];
91 if (isset($_GET["action"]))$action=$_GET["action"];
93 if (isset($_GET["off"]))$off=$_GET["off"];
94 if (isset($_GET["id"]))$id=$_GET["id"];
96 if (isset($_POST["str"]))$str=$_POST["str"];
97 if (isset($_POST["idx"]))$idx=$_POST["idx"];
98 if (isset($_POST["action"]))$action=$_POST["action"];
102 echo '<' . '?xml version="1.0" encoding="' . _("ISO-8859-1") .'"?' . ">\n";
103 echo '<' . '?xml-stylesheet href="#internalStyle" type="text/css"?' . ">\n";
105 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
106 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
107 <html xmlns="http://www.w3.org/1999/xhtml">
109 <title>PLD Build Logs</title>
110 <?php echo '<meta http-equiv="Content-type" content="text/html; charset=' . _("ISO-8859-1") .'"/>' ."\n";?>
111 <style type="text/css"><!--
112 A { text-decoration: none; }
113 A:hover { text-decoration: underline; }
114 H1 { font-family: arial,helvetica,sans-serif;
117 H2 { font-family: arial,helvetica,sans-serif;
120 BODY,TD { font-family: arial,helvetica,sans-serif;
122 TH { font-family: arial,helvetica,sans-serif;
128 <!-- Diffrent color for visited link doesn't make much sense here...
129 this page is autogenerated and it might be misleading after some
130 build log changes. -->
131 <body bgcolor="#ffffff" text="#000000" link="#5f26cd" vlink="#5f26cd">
137 echo "<table cellpadding=\"10\"><tr><td bgcolor=\"#000000\">".
138 "<font color=\"#cccccc\"><pre>";
143 echo "</pre></font></td></tr></table>\n";
148 echo "</body></html>";
154 echo "Fatal error: $msg";
157 function open_ftp($pidx="", $pok="")
159 global $idx, $addr, $buildlogs_server, $ok;
160 global $ftp_conn, $big_url, $url, $ns;
163 if ($pidx==="")$pidx=$idx;
164 if ($pok==="")$pok=$ok;
166 if (!isset($pidx) || !isset($addr[$pidx]))
175 $a = "$addr[$pidx]/OK";
177 $a = "$addr[$pidx]/FAIL";
185 $big_url = "$url?idx=$idx&ok=$ok&ns=$ns&cnt=$cnt";
187 $ftp = ftp_connect($buildlogs_server);
190 mydie(_("cannot connect to")." $buildlogs_server");
194 if (ftp_login($ftp, "anonymous",
195 "buildlogs-iface@pld-linux.org") == false) {
197 mydie(_("cannot ftp login to")." $buildlogs_server");
201 $list = ftp_nlist($ftp, $a);
202 if ($list == false) {
204 mydie(_("cannot list")." $a");
213 function directory_list($pidx="",$pok="")
215 global $idx, $addr, $buildlogs_server, $ok;
216 global $root_directory, $big_url, $url, $ns;
219 if ($pidx==="")$pidx=$idx;
220 if ($pok==="")$pok=$ok;
221 if (!isset($pidx) || !isset($addr[$pidx]))
230 $a = "$addr[$pidx]/OK";
232 $a = "$addr[$pidx]/FAIL";
240 $big_url = "$url?idx=$idx&ok=$ok&ns=$ns&cnt=$cnt";
242 $dir = opendir("$root_directory$a");
245 while ($file = readdir($dir)) {
246 if (($file != ".") && ($file != "..")) {
247 $list[$i] = "$a/$file";
257 global $idx, $addr, $ok;
258 global $ftp_conn, $big_url, $ns, $qa_addr;
259 global $off, $cnt, $local, $root_directory;
262 $list = directory_list();
270 echo "<h1>"._("Listing of")." $addr[$idx]/OK "
271 ."(<a href=\"$big_url&ok=0\">"._("fail")."</a>)</h1>\n";
273 echo "<h1>"._("Listing of")." $addr[$idx]/FAIL "
274 ."(<a href=\"$big_url&ok=1\">"._("ok")."</a>)</h1>\n";
277 echo "<div align=\"center\"><table cols=\"4\" border=\"0\" cellspacing=\"1\" ".
278 "cellpadding=\"3\" bgcolor=\"#000000\" width=\"90%\">\n";
279 echo "<tr><th bgcolor=\"#CCCCFF\" align=\"right\" width=\"1%\">"._("No.")."</th>".
280 "<th bgcolor=\"#CCCCFF\" align=\"left\" width=\"80%\">"._("Log File").
281 "[<a href=\"$big_url&ns=1\">"._("sort")."</a>]</th>".
282 "<th bgcolor=\"#CCCCFF\" align=\"right\" width=\"15%\">"._("Size")."</th> ".
283 "<th bgcolor=\"#CCCCFF\" align=\"left\">"._("Age").
284 "[<a href=\"$big_url&ns=0\">"._("sort")."</a>]</th>".
287 function cmp($f1, $f2) {
288 global $ftp_conn, $root_directory, $local;
290 return filemtime("$root_directory$f2") - filemtime("$root_directory$f1");
291 return ftp_mdtm($ftp_conn, $f2) - ftp_mdtm($ftp_conn, $f1);
302 for ($i = $off; $i < $cnt + $off; $i++) {
303 if (!isset($list[$i]))
305 $h = bin2hex(mhash(MHASH_MD5, $list[$i]));
306 $f = preg_replace("/.*\/([^\/]*)$/", "\\1", $list[$i]);
307 $f = preg_replace("/\.(bz2|gz)$/", "", $f);
309 $s = filesize("$root_directory$list[$i]");
310 $t = $now - filemtime("$root_directory$list[$i]");
312 $s = ftp_size($ftp_conn, $list[$i]);
313 $t = $now - ftp_mdtm($ftp_conn, $list[$i]);
321 $t = $t . " " . ngettext("day","days",$t);
324 $t = $t . " " . ngettext("hour","hours",$t);
328 $t = $t . " " . ngettext("minute","minutes",$t);
330 $u = "$big_url&off=$off&id=$h";
331 echo "<tr><td bgcolor=\"#CCCCCC\" align=\"right\">".($i+1).".</td>".
332 "<td bgcolor=\"#CCCCCC\"><a href=\"$u\">$f</a> ".
333 "[<a href=\"$u&action=text\">"._("text")."</a> | ".
334 "<a href=\"$u&action=tail\">"._("tail")."</a>]".
335 "</td><td bgcolor=\"#CCCCCC\" align=\"right\">".
336 "$s</td><td bgcolor=\"#CCCCCC\">$t</td></tr>\n";
338 echo "</table></div>\n";
340 $backarr = "<<< ";
341 $back = _("Page back");
342 $forward = _("Page forward");
343 $forwardarr = " >>>";
345 echo "<p><table width=\"90%\" align=\"center\"><tr><td align=\"left\" width=\"1%\">";
351 $hrefurl = "<a href=\"$big_url&off=$noff\">";
352 echo "$hrefurl$backarr</a></td><td align=\"left\">$hrefurl$back</a>";
354 echo "$backarr</td><td align=\"left\">$back";
357 echo "</td>\n<td align=\"center\">";
359 if ($qa_addr[$idx] != "") {
360 echo "[<a href=\"$big_url&action=qa\">"._("View <quot>rpm -qa</quot> of builder")."</a>]";
365 echo "</td>\n<td align=right>";
366 if ($off + $cnt < count($list)) {
370 $hrefurl = "<a href=\"$big_url&off=$noff\">";
371 echo "$hrefurl$forward</a></td><td align=right width=1%>$hrefurl$forwardarr</a>";
373 echo "$forward</td><td align=right width=1%>$forwardarr";
375 echo "</td>\n</tr></table></p>";
384 global $idx, $addr, $ok;
385 global $ftp_conn, $root_directory, $big_url, $ns, $id;
386 global $buildlogs_server, $local;
391 $list = directory_list();
399 for ($i = 0; $i < count($list); $i++) {
400 $h = bin2hex(mhash(MHASH_MD5, $list[$i]));
407 mydie(_("cannot find specified file:")." $id");
416 function dump_log($tail)
418 global $idx, $addr, $ok, $url;
419 global $ftp_conn, $root_directory, $big_url, $ns, $id, $cnt, $off;
420 global $buildlogs_server, $local, $qa_addr;
427 $df = preg_replace("/.*\/([^\/]*)$/", "\\1", $f);
428 $df = preg_replace("/\.(bz2|gz)$/", "", $df);
432 echo "<table border=\"0\" cellpadding=\"3\" cellspacing=\"1\" bgcolor=\"#000000\">";
434 function one_item($h, $t) {
435 echo "<tr><td bgcolor=\"#ccccff\">$h:</td>".
436 "<td bgcolor=\"#cccccc\">$t</td></tr>";
439 function href($h, $c) {
440 return "<a href=\"$h\">$c</a>";
443 one_item(_("Status"), ($ok == 1 ?
444 "<font color=green><b>"._("OK")."</b></font>" :
445 "<font color=red><b>"._("Failed")."</b></a>"));
446 one_item(_("Source URL"),
447 href("ftp://$buildlogs_server$f",
448 "ftp://$buildlogs_server$f"));
450 $bu = "$big_url&off=$off";
452 one_item(_("text/plain URL"),
453 href("$bu&id=$id&action=text",
456 one_item(_("full text"),
457 href("$bu&id=$id",
461 if ($qa_addr[$idx] != "") {
462 one_item(_("rpm -qa of builder"), href("$bu&action=qa", _("View!")));
464 one_item(_("rpm -qa of builder"), _("Not available"));
467 one_item("Data", date("Y/m/d H:i:s", filemtime("$root_directory$f")));
469 one_item("Data", date("Y/m/d H:i:s", ftp_mdtm($ftp_conn, $f)));
472 echo "<tr><td>Here:</td><td>" .
473 "<a href=\"$url?idx=$idx&ok=$ok&id=$id\">".
474 "http://" . getenv("SERVER_NAME") .
475 getenv("SCRIPT_NAME") . "?idx=$idx&ok=$ok&id=$id</a>" .
478 echo "</table><h2>"._("Content:")."</h2>";
486 # what can I say beside PHP suxx? how the fuck should I create
487 # bidirectional pipe? gotta use wget
489 if (preg_match("/\.bz2$/", $f)) {
491 } elseif (preg_match("/\.gz$/", $f)) {
498 $cmd = "$filter $root_directory$f";
500 $cmd = "wget -q -O - ftp://$buildlogs_server$f 2>&1 | $filter 2>&1";
503 $cmd = "$cmd | tail -n 100";
504 $fd = popen($cmd, "r");
506 while (($s = fgets($fd, 1000)) != false) {
507 $s = htmlspecialchars($s);
517 [<a href="<?php echo $bu; ?>"><?=_("Back to list of logs")?></a>]
520 [<a href="<?php echo "$bu&action=qa"
521 ?>"><?=_("View rpm -qa of builder")?></a>]
531 global $ftp_conn, $root_directory;
532 global $buildlogs_server, $local;
534 header("Content-type: text/plain");
541 echo "# src : ftp://$buildlogs_server$f\n";
544 date("Y/m/d H:i:s", filemtime("$root_directory$f")) . "\n";
547 date("Y/m/d H:i:s", ftp_mdtm($ftp_conn, $f)) . "\n";
552 if (preg_match("/\.bz2$/", $f)) {
554 } elseif (preg_match("/\.gz$/", $f)) {
561 $cmd = "$filter $root_directory$f";
563 $cmd = "wget -q -O - ftp://$buildlogs_server$f 2>&1 | $filter 2>&1";
565 $fd = popen($cmd, "r");
566 while (($s = fgets($fd, 1000)) != false) {
572 function list_archs()
574 global $addr, $url, $idx, $cnt,$ok,$ns;
579 $big_url = "$url?idx=$idx&ok=$ok&ns=$ns&cnt=$cnt";
581 echo "<table width=\"100%\" border=\"0\">\n";
582 echo "<tr><td bgcolor=\"#cccccc\" nowrap=\"nowrap\">"._("Failed")."</td><td bgcolor=\"#cccccc\">"._("Ok")."</td></tr>\n";
583 for ($i = 0; $i < count($addr); $i++)
584 echo "<tr><td nowrap=\"nowrap\">".
585 "<a href=\"$url?idx=$i&ok=0&cnt=$cnt\">$addr[$i]</a></td><td nowrap=\"nowrap\">".
586 "[<a href=\"$url?idx=$i&ok=1&cnt=$cnt\">OK</a>]</td>".
587 #"<td>[<a href=\"$url?idx=$i&action=qa\">qa</a>]</td>".
589 echo "</table><hr />\n";
591 echo "<div align=\"center\">";
592 echo "<a href=\"$big_url&action=adv_search\">"._("Advanced Search")."</a><br />\n";
594 echo "<a href=\"$url\">main()</a><hr />\n";
595 echo "<a href=\"http://www.pld-linux.org/\"><img src=\"powpld.png\" ".
596 "alt=\""._("Powered by PLD Linux")."\" border=\"0\" /></a><br />\n" .
598 "<a href=\"mailto:feedback@pld-linux.org\">PLD Team</a>\n".
602 echo "<div align=\"center\"><small>";
603 $pow = array("vim", "php", "brain", "power", "electricity",
604 "coffee", "ufo", "penguin", "GNOME", "ELF", "DWARF",
605 "voodoo magic", "Linux", "x-files", "X", "foobar",
606 "/dev/null", "/dev/zero", "/dev/drzewo",
607 "Leppe'", "matrix", "Neo", "PDP-11",
608 "Ken", "GNU antilope", "PDP-7", "ITS", "Multics",
609 "foobarbaz", "ed", "Joe", "Unix conspiracy",
610 "overclock", "The Right Thing",
611 "The Bad Thing", "Star Treck", "NSA", "NASA",
612 "achelon", "VAX", "Real Programmer",
613 "Real Operating System", "Real Computer",
614 "computron", "bogon", "quantum bogodynamics",
615 "BOFH", "/dev/ill", "nasi tu byli",
616 "Paranoid Android", "Lunatic Corp", "Parallel thinking",
617 "sfistak", "Linus", "The Golden Path", "Dark Side of the Force",
618 "Przewodniczacego Lepper-a", "KDE", "Microsoft Windows 2003"
619 # feel free to add sth if you change this file ;)
621 echo _("Powered by")." ";
623 for ($i = 0; $i < $max; $i++) {
624 $x = rand(0, count($pow) - 1);
625 if ($pow[$x] == "") $i--;
626 else echo $pow[$x] . ($i == $max - 1 ? "." : ", ");
629 echo "</small></div>";
633 if (isset($qa_addr[$idx]) && $qa_addr[$idx] != "") {
634 echo "<form action=\"index.php\" method=\"post\">";
635 echo "<input type=hidden name=idx value=$idx />";
636 echo "<input type=hidden name=action value=sqa />";
637 echo "<input type=text size=14 name=str /><br />";
638 echo "<input type=submit name=submit value=\""._("Search rpmqa!")."\" />";
645 global $idx, $qa_addr;
647 if (!isset($idx) || !isset($qa_addr[$idx]))
652 if ($qa_addr[$idx] == "")
655 return fopen("$qa_addr[$idx]", "r");
660 global $url, $idx, $qa_addr, $str;
663 echo "<h1>"._("Search results for")." '$str' "._("in")." $qa_addr[$idx]</h1>";
668 echo _("Sorry, cannot open.");
670 while (($s = fgets($f, 1000)) != false) {
671 if (stristr($s, $str))
679 function dump_qa($plain)
681 global $url, $idx, $qa_addr;
688 header("Content-type: text/plain");
689 echo _("# rpm -qa of")." $a\n";
691 echo "<h1>"._("rpm -qa of")." $a</h1>";
692 echo "<a href=\"$url?idx=$idx&action=qatxt\">"._("text/plain version")."</a>";
697 echo _("Sorry, cannot open.");
699 while (($s = fgets($f, 1000)) != false) {
709 function adv_search()
711 global $addr, $url, $local, $_POST, $off, $cnt, $root_directory;
713 $big_url = "$url?idx=$idx&ok=$ok&ns=$ns&cnt=$cnt";
715 echo "<form action=\"index.php?action=adv_search\" method=\"post\">";
717 echo "<div align=\"center\">";
718 echo "<table border=\"0\">\n";
720 echo "<td>"._("Package name")."</td>\n";
721 echo "<td><input type=\"text\" size=\"20\" name=\"name\" value=\"".$_POST[name]."\"/></td>\n";
725 echo "<td>"._("Days")."</td>\n";
726 echo "<td>"._("From").": <input type=\"text\" size=\"20\" name=\"age1\" value=\"".$_POST["age1"]."\" /></td>\n";
727 echo "<td>"._("To").": <input type=\"text\" size=\"20\" name=\"age2\" value=\"".$_POST["age2"]."\" /></td>\n";
731 echo "<td>"._("Size")."</td>\n";
732 echo "<td>"._("From").": <input type=\"text\" size=\"20\" name=\"size1\" value=\"".$_POST["size1"]."\" /></td>\n";
733 echo "<td>"._("To").": <input type=\"text\" size=\"20\" name=\"size2\" value=\"".$_POST["size2"]."\" /></td>\n";
737 echo "<td>"._("Search logs:")."</td>\n";
741 echo "<td>"._("Failed")."</td>\n";
742 echo "<td>"._("OK")."</td>\n";
745 for ($i = 0; $i < count($addr); $i++)
749 $check=" checked=\"on\"";
750 echo "<td><input name=$name type=\"checkbox\"$check>".$addr[$i]."</input></td>\n";
752 $check=" checked=\"on\"";
753 echo "<td><input name=$name type=\"checkbox\"$check>".$addr[$i]."</input></td>\n";
758 echo "<td><input type=submit name=submit value=\""._("Search!")."\" /></td>";
763 // if (isset($_POST["name"]) || isset($_POST["age1"]) || isset($_POST["age2"]) ||
764 // isset($_POST["size1"]) || isset($_POST["size2"]))
765 if (($_POST["name"]!="") || ($_POST["age1"]!="") || ($_POST["age2"]!="") ||
766 ($_POST["size1"]!="") || ($_POST["size2"]!=""))
770 for ($i = 0; $i < count($addr); $i++)
775 if (isset($_POST["as".$j."_".$i]))
778 $tmp_list = directory_list($i,$j);
780 $tmp_list = open_ftp($i,$j);
782 if (is_array($tmp_list))
784 while (list($k,$name)=each($tmp_list))
786 $s = filesize("$root_directory$name");
787 $t = $now - filemtime("$root_directory$name");
789 if (($_POST["name"]!="") && (!preg_match("/".$_POST["name"]."/i",$name)))continue;
790 if (($_POST["age1"]) && ($_POST["age1"]>$t))continue;
791 if (($_POST["age2"]) && ($_POST["age2"]<$t))continue;
793 if (($_POST["size1"]) && ($_POST["size1"]>$s))continue;
794 if (($_POST["size2"]) && ($_POST["size2"]<$s))continue;
796 $list[$i."_".$j."_".$k]=$name;
802 if (sizeof($list)==0)
804 echo _("Nothing found");
808 echo "<table border=\"0\" cellspacing=\"1\" ".
809 "cellpadding=3 bgcolor=\"#000000\" width=\"90%\">\n";
810 echo "<tr><th bgcolor=\"#CCCCFF\" align=\"left\" width=\"10%\">"._("Builder").
811 "[<a href=\"$big_url&ns=2\">"._("sort")."</a>]</th>";
812 echo "<th bgcolor=\"#CCCCFF\" align=\"left\" width=\"60%\">"._("Log File").
813 "[<a href=\"$big_url&ns=1\">"._("sort")."</a>]</th>".
814 "<th bgcolor=\"#CCCCFF\" align=\"right\" width=\"15%\">"._("Size")."</th> ".
815 "<th bgcolor=\"#CCCCFF\" align=\"left\">"._("Age").
816 "[<a href=\"$big_url&ns=0\">"._("sort")."</a>]</th>".
819 function cmp1($f1, $f2) {
820 global $ftp_conn, $root_directory, $local;
822 return filemtime("$root_directory$f2") - filemtime("$root_directory$f1");
823 return ftp_mdtm($ftp_conn, $f2) - ftp_mdtm($ftp_conn, $f1);
826 function cmp2($f1, $f2) {
827 list($p11,$p12,$p13)=explode("_",$f1);
828 list($p21,$p22,$p23)=explode("_",$f2);
829 return strcmp($f2,$f1);
834 usort($list, "cmp1");
835 // } else if ($ns == 2)
837 // uksort($list, "cmp2");
844 while (list($k,$name)=each($list))
846 if (($counter<$off) || ($counter>$off+$cnt-1))
853 list($i,$j,$k)=explode("_",$k);
855 $h = bin2hex(mhash(MHASH_MD5, $name));
856 $f = preg_replace("/.*\/([^\/]*)$/", "\\1", $name);
857 $f = preg_replace("/\.(bz2|gz)$/", "", $f);
859 $s = filesize("$root_directory$name");
860 $t = $now - filemtime("$root_directory$name");
862 $s = ftp_size($ftp_conn, $list[$i]);
863 $t = $now - ftp_mdtm($ftp_conn, $list[$i]);
871 $t = $t . " " . ngettext("day","days",$t);
874 $t = $t . " " . ngettext("hour","hours",$t);
878 $t = $t . " " . ngettext("minute","minutes",$t);
880 $big_url = "$url?idx=$i&ok=$j&ns=$ns&cnt=$cnt";
881 $u = "$big_url&off=$off&id=$h";
883 $builder=$addr[$i]."/".(($j=="1")?"OK":"FAIL");
885 echo "<td bgcolor=#CCCCCC><a href=\"$u\">$builder</a></td>";
886 echo "<td bgcolor=#CCCCCC><a href=\"$u\">$f</a> ".
887 "[<a href=\"$u&action=text\">"._("text")."</a> | ".
888 "<a href=\"$u&action=tail\">"._("tail")."</a>]".
889 "</td><td bgcolor=#CCCCCC align=right>".
890 "$s</td><td bgcolor=#CCCCCC>$t</td></tr>\n";
892 echo "</table></div>\n";
894 $backarr = "<<< ";
895 $back = _("Page back");
896 $forward = _("Page forward");
897 $forwardarr = " >>>";
901 echo "<p><table width=\"90%\" align=\"center\"><tr><td align=left width=1%>";
907 $hrefurl = "<a href=\"$big_url&off=$noff\">";
908 echo "$hrefurl$backarr</a></td><td align=left>$hrefurl$back</a>";
910 echo "$backarr</td><td align=left>$back";
913 echo "</td>\n<td align=\"center\">";
914 echo "</td>\n<td align=\"right\">";
916 if ($off + $cnt < count($list))
921 $hrefurl = "<a href=\"$big_url&off=$noff\">";
922 echo "$hrefurl$forward</a></td><td align=\"right\" width=\"1%\">$hrefurl$forwardarr</a>";
926 echo "$forward</td><td align=\"right\" width=\"1%\">$forwardarr";
929 echo "</td>\n</tr></table></p>";
939 echo _("Enter something!");
947 <table border="0" width="100%"><tr><td width="20%"> </td><td>
948 <h1><?=_("Welcome!")?></h1>
949 <p><?=_("Welcome to PLD Build Logs WWW interface.")?></p><p>
950 <?=_("Feel free to email bug reports, complaints and feature requests ")?>
951 <!-- ech... niech strace... -->
952 <a href="mailto:feedback@pld-linux.org"><?=_("to us")?></a>. <?=_("Positive opinions are also")?>
953 <a href="mailto:feedback@pld-linux.org"><?=_("welcome")?></a> ;)</p>
954 <p>Version: $Id: index.php,v 1.73 2004/05/16 08:06:45 ankry Exp $</p>
955 </td><td width="20%"> </td></tr>
960 header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
961 header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
962 header("Cache-Control: no-cache, must-revalidate");
963 header("Pragma: no-cache");
967 if ($action == "text") {
969 } else if ($action == "adv_search") {
973 } else if ($action == "qatxt") {
977 echo "<table cellpadding=\"10\" width=\"100%\"><tr><td valign=\"top\" width=\"10%\">";
979 echo "</td><td valign=\"top\">";
983 else if ($action == "sqa")
986 dump_log($action == "tail");
987 else if (isset($idx))
991 echo "</td></tr></table>";
997 if ($action == "text") {
999 } else if ($action == "qatxt") {
1003 echo "<table cellpadding=\"10\" width=\"100%\"><tr><td valign=top width=\"10%\">";
1005 echo "</td><td valign=\"top\">";
1007 if ($action == "qa")
1009 else if (isset($id))
1010 dump_log($action == "tail");
1011 else if (isset($idx))
1015 echo "</td></tr></table>";