<?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",
- "",
- ""
+ "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 */
+$langs["en_US"]["charset"]="ISO-8859-1";
+$langs["pl_PL"]["charset"]="ISO-8859-2";
+
+$lang="en_US";
+if (isset($_SERVER["HTTP_ACCEPT_LANGUAGE"]))
+{
+ $rows=explode(";",$_SERVER["HTTP_ACCEPT_LANGUAGE"]);
+ $rows=explode(",",$rows[0]);
+ $lang_detected=rtrim($rows[0]);
+} else if (preg_match("/opera/i",$_SERVER["HTTP_USER_AGENT"]))
+{
+ $lang_detected=preg_replace("/.*\[(.*)\].*/i","\\1",$_SERVER["HTTP_USER_AGENT"]);
+}
+
+// FIXME - some array
+$lang_detected=preg_replace("/^pl$/i","pl_PL",$lang_detected);
+
+if (isset($lang_detected) && isset($langs[$lang_detected]))
+{
+ $lang=$lang_detected;
+}
+
+if (isset($_GET["lang"]))$_SESSION["lang"]=$_GET["lang"];
+if (isset($_SESSION["lang"]))$lang=$_SESSION["lang"];
+
+putenv("LANG=$lang");
+setlocale(LC_ALL,$lang);
+bindtextdomain("messages","locale");
+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"];
+
+if (isset($_POST["str"]))$str=$_POST["str"];
+if (isset($_POST["idx"]))$idx=$_POST["idx"];
+if (isset($_POST["action"]))$action=$_POST["action"];
function myheader()
{
+echo '<' . '?xml version="1.0" encoding="' . _("ISO-8859-1") .'"?' . ">\n";
+echo '<' . '?xml-stylesheet href="#internalStyle" type="text/css"?' . ">\n";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>PLD Build Logs</title>
- <style TYPE="text/css"><!--
+ <?php echo '<meta http-equiv="Content-type" content="text/html; charset=' . _("ISO-8859-1") .'"/>' ."\n";?>
+ <style type="text/css"><!--
A { text-decoration: none; }
A:hover { text-decoration: underline; }
H1 { font-family: arial,helvetica,sans-serif;
function start_pre()
{
- echo "<table cellpadding=10><tr><td bgcolor=\"#000000\">".
- "<font color=\"#cccccc\"><pre>";
+ echo "<table cellpadding=\"10\"><tr><td bgcolor=\"#000000\">".
+ "<font color=\"#cccccc\"><pre style=\"width: 2048px;overflow: scroll\">";
}
function end_pre()
echo "Fatal error: $msg";
}
-function open_ftp()
+function open_ftp($pidx="", $pok="")
{
global $idx, $addr, $buildlogs_server, $ok;
global $ftp_conn, $big_url, $url, $ns;
global $off, $cnt;
- if (!isset($idx) || !isset($addr[$idx]))
+ if ($pidx==="")$pidx=$idx;
+ if ($pok==="")$pok=$ok;
+
+ if (!isset($pidx) || !isset($addr[$pidx]))
return false;
-
- if ($ok != 1)
- $ok = 0;
+
+ if ($pok != 1)
+ $pok = 0;
if ($ns != 1)
$ns = 0;
-
- if ($ok == 1) {
- $a = "$addr[$idx]/OK";
+
+ if ($pok == 1) {
+ $a = "$addr[$pidx]/OK";
} else {
- $a = "$addr[$idx]/FAIL";
+ $a = "$addr[$pidx]/FAIL";
}
-
+
if (!isset($off))
$off = 0;
if (!isset($cnt))
$cnt = 16;
-
- $big_url = "$url?idx=$idx&ok=$ok&ns=$ns";
-
+
+ $big_url = "$url?idx=$idx&ok=$ok&ns=$ns&cnt=$cnt";
+
$ftp = ftp_connect($buildlogs_server);
-
+
if ($ftp == false) {
- mydie("cannot connect to $buildlogs_server");
+ mydie(_("cannot connect to")." $buildlogs_server");
return false;
}
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");
+ mydie(_("cannot ftp login to")." $buildlogs_server");
return false;
}
$list = ftp_nlist($ftp, $a);
if ($list == false) {
ftp_quit($ftp);
- mydie("cannot list $a");
+ mydie(_("cannot list")." $a");
return false;
}
$ftp_conn = $ftp;
-
+
return $list;
}
-function directory_list()
+function directory_list($pidx="",$pok="")
{
global $idx, $addr, $buildlogs_server, $ok;
global $root_directory, $big_url, $url, $ns;
global $off, $cnt;
-
- if (!isset($idx) || !isset($addr[$idx]))
+
+ if ($pidx==="")$pidx=$idx;
+ if ($pok==="")$pok=$ok;
+ if (!isset($pidx) || !isset($addr[$pidx]))
return false;
-
- if ($ok != 1)
- $ok = 0;
+
+ if ($pok != 1)
+ $pok = 0;
if ($ns != 1)
$ns = 0;
-
- if ($ok == 1) {
- $a = "$addr[$idx]/OK";
+
+ if ($pok == 1) {
+ $a = "$addr[$pidx]/OK";
} else {
- $a = "$addr[$idx]/FAIL";
+ $a = "$addr[$pidx]/FAIL";
}
-
+
if (!isset($off))
$off = 0;
if (!isset($cnt))
$cnt = 16;
-
- $big_url = "$url?idx=$idx&ok=$ok&ns=$ns";
-
+
+ $big_url = "$url?idx=$idx&ok=$ok&ns=$ns&cnt=$cnt";
+
$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++;
}
}
function list_logs()
{
global $idx, $addr, $ok;
- global $ftp_conn, $big_url, $ns;
- global $off, $cnt;
-
- $list = open_ftp();
+ global $ftp_conn, $big_url, $ns, $qa_addr;
+ global $off, $cnt, $local, $root_directory;
+ if ($local) {
+ $list = directory_list();
+ } else {
+ $list = open_ftp();
+ }
if ($list == false)
return;
-
+
if ($ok == 1) {
- echo "<h1>Listing of $addr[$idx]/OK "
- ."(<a href=\"$big_url&ok=0\">fail</a>)</h1>";
+ echo "<h1>"._("Listing of")." $addr[$idx]/OK "
+ ."(<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>";
+ echo "<h1>"._("Listing of")." $addr[$idx]/FAIL "
+ ."(<a href=\"$big_url&ok=1\">"._("ok")."</a>)</h1>\n";
}
-
- echo "<div align=center><table border=0 cellspacing=1 ".
- "cellpadding=3 bgcolor=#000000 width=90%>\n";
- echo "<tr><th bgcolor=#CCCCFF align=left width=60%>Log File ".
- "[<a href=\"$big_url&ns=1\">sort</a>]</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>";
-
- function cmp($f1, $f2) {
- global $ftp_conn;
+ echo "<div align=\"center\"><table cols=\"4\" border=\"0\" cellspacing=\"1\" ".
+ "cellpadding=\"3\" bgcolor=\"#000000\" width=\"90%\">\n";
+ 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=\"left\">"._("Age").
+ "[<a href=\"$big_url&ns=0\">"._("sort")."</a>]</th>".
+ "</tr>";
+
+ function cmp($f1, $f2) {
+ global $ftp_conn, $root_directory, $local;
+ if ($local)
+ 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);
- $s = ftp_size($ftp_conn, $list[$i]);
- $t = $now - ftp_mdtm($ftp_conn, $list[$i]);
+ if ($local) {
+ $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]);
+ }
$t /= 60;
if ($t >= 60) {
$t /= 60;
if ($t >= 24) {
$t /= 24;
- $t = round($t) . " days";
+ $t = round($t);
+ $t = $t . " " . ngettext("day","days",$t);
} else {
- $t = round($t) . " hour";
+ $t = round($t);
+ $t = $t . " " . ngettext("hour","hours",$t);
}
} else {
- $t = round($t) . " minutes";
+ $t = round($t);
+ $t = $t . " " . ngettext("minute","minutes",$t);
}
- $u = "$big_url&cnt=$cnt&off=$off&id=$h";
- echo "<tr><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";
+ $u = "$big_url&off=$off&id=$h";
+ 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\">".
+ "$s</td><td bgcolor=\"#CCCCCC\">$t</td></tr>\n";
}
echo "</table></div>\n";
- $back = "<<< Page back";
- $forward = "Page forward >>>";
+ $backarr = "<<< ";
+ $back = _("Page back");
+ $forward = _("Page forward");
+ $forwardarr = " >>>";
- echo "<p align=center><table width=90%><tr><td align=left width=25%>";
+ echo "<p><table width=\"90%\" align=\"center\"><tr><td align=\"left\" width=\"1%\">";
if ($off > 0) {
$noff = $off - $cnt;
if ($noff < 0)
$noff = 0;
- echo "<a href=\"$big_url&cnt=$cnt&off=$noff\">$back</a>\n";
+ $hrefurl = "<a href=\"$big_url&off=$noff\">";
+ echo "$hrefurl$backarr</a></td><td align=\"left\">$hrefurl$back</a>";
} else {
- echo "$back\n";
+ echo "$backarr</td><td align=\"left\">$back";
}
-
- echo "</td><td width=50% align=center>";
-
- echo "[<a href=\"$big_url&action=qa\">View rpm -qa of ".
- "builder</a>]\n";
-
- echo "</td><td align=right width=25%>";
- if ($off + $cnt < count($list)) {
- $noff = $off + $cnt;
- if ($noff < 0)
- $noff = 0;
- echo "<a href=\"$big_url&cnt=$cnt&off=$noff\">$forward</a>\n";
- } else {
- echo "$forward\n";
- }
- echo "</td></tr></table></p>";
-
- ftp_quit($ftp_conn);
- $ftp_conn = 0;
-}
-
-function local_list_logs()
-{
- global $idx, $addr, $ok;
- global $root_directory, $big_url, $ns;
- global $off, $cnt;
- $list = directory_list();
+ echo "</td>\n<td align=\"center\">";
- if ($list == false)
- return;
-
- if ($ok == 1) {
- echo "<h1>Listing of $addr[$idx]/OK "
- ."(<a href=\"$big_url&ok=0\">fail</a>)</h1>";
- } else {
- echo "<h1>Listing of $addr[$idx]/FAIL "
- ."(<a href=\"$big_url&ok=1\">ok</a>)</h1>";
- }
-
- echo "<div align=center><table border=0 cellspacing=1 ".
- "cellpadding=3 bgcolor=#000000 width=90%>\n";
- echo "<tr><th bgcolor=#CCCCFF align=left width=60%>Log File ".
- "[<a href=\"$big_url&ns=1\">sort</a>]</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>";
-
- function cmp($f1, $f2) {
- global $root_directory;
-
- return filemtime("$root_directory$f2") - filemtime("$root_directory$f1");
- }
-
- if ($ns != 1) {
- $ns = 0;
- usort($list, cmp);
+ if ($qa_addr[$idx] != "") {
+ echo "[<a href=\"$big_url&action=qa\">"._("View <quot>rpm -qa</quot> of builder")."</a>]";
} else {
- sort($list);
+ echo " ";
}
-
- $now = time();
- for ($i = $off; $i < $cnt + $off; $i++) {
- if (!isset($list[$i]))
- continue;
- $h = bin2hex(mhash(MHASH_MD5, $list[$i]));
- $f = preg_replace("/.*\/([^\/]*)$/", "\\1", $list[$i]);
- $f = preg_replace("/\.(bz2|gz)$/", "", $f);
- $s = filesize("$root_directory$list[$i]");
- $t = $now - filemtime("$root_directory$list[$i]");
- $t /= 60;
- if ($t >= 60) {
- $t /= 60;
- if ($t >= 24) {
- $t /= 24;
- $t = round($t) . " days";
- } else {
- $t = round($t) . " hour";
- }
- } else {
- $t = round($t) . " minutes";
- }
- $u = "$big_url&cnt=$cnt&off=$off&id=$h";
- echo "<tr><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";
- }
- echo "</table></div>\n";
-
- $back = "<<< Page back";
- $forward = "Page forward >>>";
- echo "<p align=center><table width=90%><tr><td align=left width=25%>";
-
- if ($off > 0) {
- $noff = $off - $cnt;
- if ($noff < 0)
- $noff = 0;
- echo "<a href=\"$big_url&cnt=$cnt&off=$noff\">$back</a>\n";
- } else {
- echo "$back\n";
- }
-
- echo "</td><td width=50% align=center>";
-
- echo "[<a href=\"$big_url&action=qa\">View rpm -qa of ".
- "builder</a>]\n";
-
- echo "</td><td align=right width=25%>";
+ echo "</td>\n<td align=right>";
if ($off + $cnt < count($list)) {
$noff = $off + $cnt;
if ($noff < 0)
$noff = 0;
- echo "<a href=\"$big_url&cnt=$cnt&off=$noff\">$forward</a>\n";
+ $hrefurl = "<a href=\"$big_url&off=$noff\">";
+ echo "$hrefurl$forward</a></td><td align=right width=1%>$hrefurl$forwardarr</a>";
} else {
- echo "$forward\n";
+ echo "$forward</td><td align=right width=1%>$forwardarr";
}
- echo "</td></tr></table></p>";
-}
-
-function file_name()
-{
- global $idx, $addr, $ok;
- global $ftp_conn, $big_url, $ns, $id;
- global $buildlogs_server;
-
- if (!isset($id))
- return false;
-
- $list = open_ftp();
-
- if ($list == false)
- return false;
-
- $f = false;
- for ($i = 0; $i < count($list); $i++) {
- $h = bin2hex(mhash(MHASH_MD5, $list[$i]));
- if ($h == $id) {
- $f = $list[$i];
- }
- }
-
- if ($f == false) {
- mydie("cannot find specified file: $id");
+ echo "</td>\n</tr></table></p>";
+ if ($local == 0) {
ftp_quit($ftp_conn);
- return false;
+ $ftp_conn = 0;
}
-
- return $f;
}
-
-function local_file_name()
+function file_name()
{
global $idx, $addr, $ok;
- global $root_directory, $big_url, $ns, $id;
- global $buildlogs_server;
+ global $ftp_conn, $root_directory, $big_url, $ns, $id;
+ global $buildlogs_server, $local;
if (!isset($id))
return false;
-
- $list = directory_list();
-
+ if ($local) {
+ $list = directory_list();
+ } else {
+ $list = open_ftp();
+ }
if ($list == false)
return false;
$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];
}
}
if ($f == false) {
- mydie("cannot find specified file: $id");
+ mydie(_("cannot find specified file:")." $id");
+ if ($local == 0)
+ ftp_quit($ftp_conn);
return false;
}
return $f;
}
-
function dump_log($tail)
{
global $idx, $addr, $ok, $url;
- global $ftp_conn, $big_url, $ns, $id, $cnt, $off;
- global $buildlogs_server;
+ global $ftp_conn, $root_directory, $big_url, $ns, $id, $cnt, $off;
+ global $buildlogs_server, $local, $qa_addr;
$f = file_name();
$df = preg_replace("/.*\/([^\/]*)$/", "\\1", $f);
$df = preg_replace("/\.(bz2|gz)$/", "", $df);
-
+
echo "<h1>$df</h1>";
- echo "<table border=0 cellpadding=3 cellspacing=1 bgcolor=#000000>";
+ echo "<table border=\"0\" cellpadding=\"3\" cellspacing=\"1\" bgcolor=\"#000000\">";
function one_item($h, $t) {
- echo "<tr><td bgcolor=#ccccff>$h:</td>".
- "<td bgcolor=#cccccc>$t</td></tr>";
+ echo "<tr><td bgcolor=\"#ccccff\">$h:</td>".
+ "<td bgcolor=\"#cccccc\">$t</td></tr>";
}
function href($h, $c) {
return "<a href=\"$h\">$c</a>";
}
-
- one_item("Status", ($ok == 1 ?
- "<font color=green><b>OK</b></font>" :
- "<font color=red><b>Failed</b></a>"));
- one_item("Source URL",
+
+ one_item(_("Status"), ($ok == 1 ?
+ "<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"));
- $bu = "$big_url&cnt=$cnt&off=$off";
-
- one_item("text/plain URL",
- href("$bu&id=$id&action=text",
- "View!"));
+ $bu = "$big_url&off=$off";
+
+ one_item(_("text/plain URL"),
+ href("$bu&id=$id&action=text",
+ _("View!")));
if ($tail) {
- one_item("full text",
- href("$bu&&id=$id",
+ one_item(_("full text"),
+ href("$bu&id=$id",
"View!"));
}
-
- one_item("rpm -qa of builder", href("$bu&action=qa", "View!"));
- one_item("Date", date("Y/m/d H:i:s", ftp_mdtm($ftp_conn, $f)));
+
+ if ($qa_addr[$idx] != "") {
+ one_item(_("rpm -qa of builder"), href("$bu&action=qa", _("View!")));
+ } else {
+ one_item(_("rpm -qa of builder"), _("Not available"));
+ }
+ if ($local) {
+ one_item("Data", date("Y/m/d H:i:s", filemtime("$root_directory$f")));
+ } else {
+ one_item("Data", date("Y/m/d H:i:s", ftp_mdtm($ftp_conn, $f)));
+ }
/*
echo "<tr><td>Here:</td><td>" .
- "<a href=\"$url?idx=$idx&ok=$ok&id=$id\">".
+ "<a href=\"$url?idx=$idx&ok=$ok&id=$id\">".
"http://" . getenv("SERVER_NAME") .
- getenv("SCRIPT_NAME") . "?idx=$idx&ok=$ok&id=$id</a>" .
+ getenv("SCRIPT_NAME") . "?idx=$idx&ok=$ok&id=$id</a>" .
"</td></tr>"; */
- echo "</table><h2>Content:</h2>";
-
- ftp_quit($ftp_conn);
- $ftp_conn = 0;
-
-
- # what can I say beside PHP suxx? how the fuck should I create
- # bidirectional pipe? gotta use wget
-
- if (preg_match("/\.bz2$/", $f)) {
- $filter = "| bzcat 2>&1";
- } elseif (preg_match("/\.gz$/", $f)) {
- $filter = "| zcat 2>&1";
- } else {
- $filter = "";
- }
+ echo "</table><h2>"._("Content:")."</h2>";
- $cmd = "wget -q -O - ftp://$buildlogs_server$f 2>&1 $filter";
- if ($tail)
- $cmd = "$cmd | tail -n 100";
- $fd = popen($cmd, "r");
- start_pre();
- while (($s = fgets($fd, 1000)) != false) {
- $s = htmlspecialchars($s);
- echo $s;
- }
- end_pre();
- pclose($fd);
-
-?>
- <table width=100%>
- <tr>
- <td align=left>
- [<a href="<?php echo $bu; ?>">Back to list of logs</a>]
- </td>
- <td align=right>
- [<a href="<?php echo "$bu&action=qa"
- ?>">View rpm -qa of builder</a>]
- </td>
- </tr>
- </table>
-<?php
-
-}
-
-
-function local_dump_log($tail)
-{
- global $idx, $addr, $ok, $url;
- global $root_directory, $big_url, $ns, $id, $cnt, $off;
- global $buildlogs_server;
-
- $f = local_file_name();
-
- if ($f == false)
- return;
-
- $df = preg_replace("/.*\/([^\/]*)$/", "\\1", $f);
- $df = preg_replace("/\.(bz2|gz)$/", "", $df);
-
- echo "<h1>$df</h1>";
-
- echo "<table border=0 cellpadding=3 cellspacing=1 bgcolor=#000000>";
-
- function one_item($h, $t) {
- echo "<tr><td bgcolor=#ccccff>$h:</td>".
- "<td bgcolor=#cccccc>$t</td></tr>";
- }
-
- function href($h, $c) {
- return "<a href=\"$h\">$c</a>";
+ if ($local == 0) {
+ ftp_quit($ftp_conn);
+ $ftp_conn = 0;
}
-
- one_item("Status", ($ok == 1 ?
- "<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"));
- $bu = "$big_url&cnt=$cnt&off=$off";
-
- one_item("text/plain URL",
- href("$bu&id=$id&action=text",
- "View!"));
- if ($tail) {
- one_item("full text",
- href("$bu&&id=$id",
- "View!"));
- }
-
- one_item("rpm -qa of builder", href("$bu&action=qa", "View!"));
- one_item("Date", date("Y/m/d H:i:s", filemtime("$root_directory$f")));
- /*
- echo "<tr><td>Here:</td><td>" .
- "<a href=\"$url?idx=$idx&ok=$ok&id=$id\">".
- "http://" . getenv("SERVER_NAME") .
- getenv("SCRIPT_NAME") . "?idx=$idx&ok=$ok&id=$id</a>" .
- "</td></tr>"; */
- echo "</table><h2>Content:</h2>";
-
# what can I say beside PHP suxx? how the fuck should I create
# bidirectional pipe? gotta use wget
-
+
if (preg_match("/\.bz2$/", $f)) {
- $cmd = "bzcat $root_directory$f";
+ $filter = "bzcat";
} elseif (preg_match("/\.gz$/", $f)) {
- $cmd = "zcat $root_directory$f";
+ $filter = "zcat";
} else {
- $cmd = "cat $root_directory$f";
+ $filter = "cat";
}
+ if ($local) {
+ $cmd = "$filter $root_directory$f";
+ } else {
+ $cmd = "wget -q -O - ftp://$buildlogs_server$f 2>&1 | $filter 2>&1";
+ }
if ($tail)
$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;
}
pclose($fd);
?>
- <table width=100%>
+ <table width="100%">
<tr>
<td align=left>
- [<a href="<?php echo $bu; ?>">Back to list of logs</a>]
+ [<a href="<?php echo $bu; ?>"><?=_("Back to list of logs")?></a>]
</td>
<td align=right>
- [<a href="<?php echo "$bu&action=qa"
- ?>">View rpm -qa of builder</a>]
+ [<a href="<?php echo "$bu&action=qa"
+ ?>"><?=_("View rpm -qa of builder")?></a>]
</td>
</tr>
</table>
function dump_text()
{
- global $ftp_conn;
- global $buildlogs_server;
-
+ global $ftp_conn, $root_directory;
+ global $buildlogs_server, $local;
+
header("Content-type: text/plain");
$f = file_name();
return;
echo "# src : ftp://$buildlogs_server$f\n";
- echo "# date : " .
- date("Y/m/d H:i:s", ftp_mdtm($ftp_conn, $f)) . "\n";
-
- ftp_quit($ftp_conn);
- $ftp_conn = 0;
-
- if (preg_match("/\.bz2$/", $f)) {
- $filter = "| bzcat 2>&1";
- } elseif (preg_match("/\.gz$/", $f)) {
- $filter = "| zcat 2>&1";
+ if ($local) {
+ echo "# date : " .
+ date("Y/m/d H:i:s", filemtime("$root_directory$f")) . "\n";
} else {
- $filter = "";
- }
-
- $cmd = "wget -q -O - ftp://$buildlogs_server$f 2>&1 $filter";
- $fd = popen($cmd, "r");
- while (($s = fgets($fd, 1000)) != false) {
- echo $s;
+ echo "# date : " .
+ date("Y/m/d H:i:s", ftp_mdtm($ftp_conn, $f)) . "\n";
+ ftp_quit($ftp_conn);
+ $ftp_conn = 0;
}
- pclose($fd);
-}
-
-
-function local_dump_text()
-{
- global $root_directory;
- global $buildlogs_server;
-
- header("Content-type: text/plain");
-
- $f = local_file_name();
-
- if ($f == false)
- return;
-
- echo "# src : ftp://$buildlogs_server$f\n";
- echo "# date : " .
- date("Y/m/d H:i:s", filemtime("$root_directory$f")) . "\n";
if (preg_match("/\.bz2$/", $f)) {
- $cmd = "bzcat";
+ $filter = "bzcat";
} elseif (preg_match("/\.gz$/", $f)) {
- $cmd = "zcat";
+ $filter = "zcat";
} else {
- $cmd = "cat";
+ $filter = "cat";
}
- $fd = popen("$cmd $root_directory$f", "r");
+ if ($local) {
+ $cmd = "$filter $root_directory$f";
+ } else {
+ $cmd = "wget -q -O - ftp://$buildlogs_server$f 2>&1 | $filter 2>&1";
+ }
+ $fd = popen($cmd, "r");
while (($s = fgets($fd, 1000)) != false) {
echo $s;
}
pclose($fd);
}
-
function list_archs()
{
- global $addr, $url, $idx;
+ global $addr, $url, $idx, $cnt,$ok,$ns;
+
+ if (!isset($cnt))
+ $cnt = 16;
+
+ $big_url = "$url?idx=$idx&ok=$ok&ns=$ns&cnt=$cnt";
- echo "<table width=100% border=0>\n";
- echo "<tr><td bgcolor=#cccccc nowrap=1>Failed</td><td bgcolor=#cccccc>Ok</td></tr>\n";
+ echo "<table width=\"100%\" border=\"0\">\n";
+ echo "<tr><td bgcolor=\"#cccccc\" nowrap=\"nowrap\">"._("Failed")."</td><td bgcolor=\"#cccccc\">"._("Ok")."</td></tr>\n";
for ($i = 0; $i < count($addr); $i++)
- echo "<tr><td nowrap=1>".
- "<a href=\"$url?idx=$i&ok=0\">$addr[$i]</a></td><td nowrap=1>".
- "[<a href=\"$url?idx=$i&ok=1\">OK</a>]</td>".
- #"<td>[<a href=\"$url?idx=$i&action=qa\">qa</a>]</td>".
+ echo "<tr><td nowrap=\"nowrap\">".
+ "<a href=\"$url?idx=$i&ok=0&cnt=$cnt\">$addr[$i]</a></td><td nowrap=\"nowrap\">".
+ "[<a href=\"$url?idx=$i&ok=1&cnt=$cnt\">OK</a>]</td>".
+ #"<td>[<a href=\"$url?idx=$i&action=qa\">qa</a>]</td>".
"</tr>\n";
echo "</table><hr />\n";
- echo "<div align=\"center\"><a href=\"$url\">main()</a><hr />\n";
- echo "<a href=\"http://www.pld.org.pl/\"><img src=powpld.png ".
- "alt=\"Powered by PLD Linux\" border=0></a><br />\n" .
+
+ echo "<div align=\"center\">";
+ 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-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 ;)
- echo "<div align=center><small>";
+ echo "<div align=\"center\"><small>";
$pow = array("vim", "php", "brain", "power", "electricity",
"coffee", "ufo", "penguin", "GNOME", "ELF", "DWARF",
"voodoo magic", "Linux", "x-files", "X", "foobar",
"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 ";
+ echo _("Powered by")." ";
$max = 1;
for ($i = 0; $i < $max; $i++) {
$x = rand(0, count($pow) - 1);
else echo $pow[$x] . ($i == $max - 1 ? "." : ", ");
$pow[$x] = "";
}
-
echo "</small></div>";
-
+
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;
$a = $qa_addr[$idx];
-
+
if ($qa_addr[$idx] == "")
return false;
else
- return fopen("$qa_base$qa_addr[$idx]", "r");
+ return fopen("$qa_addr[$idx]", "r");
}
function search_qa()
global $url, $idx, $qa_addr, $str;
$f = get_qa();
- echo "<h1>Search results for '$str' in $qa_addr[$idx]</h1>";
+ echo "<h1>"._("Search results for")." '$str' "._("in")." $qa_addr[$idx]</h1>";
start_pre();
if ($f == 0) {
- echo "Sorry, cannot open.";
+ echo _("Sorry, cannot open.");
} else {
while (($s = fgets($f, 1000)) != false) {
if (stristr($s, $str))
function dump_qa($plain)
{
global $url, $idx, $qa_addr;
-
+
$a = $qa_addr[$idx];
$f = get_qa();
-
+
if ($plain) {
header("Content-type: text/plain");
- echo "# rpm -qa of $a\n";
+ echo _("# rpm -qa of")." $a\n";
} else {
- echo "<h1>rpm -qa of $a</h1>";
- echo "<a href=\"$url?idx=$idx&action=qatxt\">text/plain "
- ."version</a>";
+ echo "<h1>"._("rpm -qa of")." $a</h1>";
+ echo "<a href=\"$url?idx=$idx&action=qatxt\">"._("text/plain version")."</a>";
start_pre();
}
if ($f == 0) {
- echo "Sorry, cannot open.";
+ echo _("Sorry, cannot open.");
} else {
while (($s = fgets($f, 1000)) != false) {
echo $s;
}
}
-
+
if (!$plain)
end_pre();
}
+
+function adv_search()
+{
+ global $addr, $url, $local, $_POST, $off, $cnt, $root_directory;
+
+ $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 "</tr>\n";
+
+ echo "<tr>\n";
+ echo "<td>"._("Days")."</td>\n";
+ echo "<td>"._("From").": <input type=\"text\" size=\"20\" name=\"age1\" value=\"".$_POST["age1"]."\" /></td>\n";
+ echo "<td>"._("To").": <input type=\"text\" size=\"20\" name=\"age2\" value=\"".$_POST["age2"]."\" /></td>\n";
+ echo "</tr>\n";
+
+ echo "<tr>\n";
+ echo "<td>"._("Size")."</td>\n";
+ echo "<td>"._("From").": <input type=\"text\" size=\"20\" name=\"size1\" value=\"".$_POST["size1"]."\" /></td>\n";
+ echo "<td>"._("To").": <input type=\"text\" size=\"20\" name=\"size2\" value=\"".$_POST["size2"]."\" /></td>\n";
+ echo "</tr>\n";
+
+ echo "<tr>\n";
+ echo "<td>"._("Search logs:")."</td>\n";
+ echo "</tr>\n";
+
+ echo "<tr>\n";
+ echo "<td>"._("Failed")."</td>\n";
+ echo "<td>"._("OK")."</td>\n";
+ echo "</tr>\n";
+
+ for ($i = 0; $i < count($addr); $i++)
+ {
+ echo "<tr>\n";
+ $name="as0_".$i;
+ $check=" checked=\"on\"";
+ 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\" id=\"$name\" type=\"checkbox\"$check /><label for=\"$name\">".$addr[$i]."</label></td>\n";
+ echo "</tr>\n";
+ }
+
+ echo "<tr>\n";
+ 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";
+
+// if (isset($_POST["name"]) || isset($_POST["age1"]) || isset($_POST["age2"]) ||
+// isset($_POST["size1"]) || isset($_POST["size2"]))
+ if (($_POST["name"]!="") || ($_POST["age1"]!="") || ($_POST["age2"]!="") ||
+ ($_POST["size1"]!="") || ($_POST["size2"]!=""))
+ {
+ unset($list);
+ $now = time();
+ for ($i = 0; $i < count($addr); $i++)
+
+ for ($j=0;$j<2;$j++)
+ {
+ unset($tmp_list);
+ if (isset($_POST["as".$j."_".$i]))
+ {
+ if ($local) {
+ $tmp_list = directory_list($i,$j);
+ } else {
+ $tmp_list = open_ftp($i,$j);
+ }
+ if (is_array($tmp_list))
+ {
+ while (list($k,$name)=each($tmp_list))
+ {
+ $s = filesize("$root_directory$name[0]");
+ $t = $now - $name[1];
+ $t/=(24*3600);
+ 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;
+
+ if (($_POST["size1"]) && ($_POST["size1"]>$s))continue;
+ if (($_POST["size2"]) && ($_POST["size2"]<$s))continue;
+
+ $list[$i."_".$j."_".$k]=$name;
+ }
+ }
+ }
+ }
+
+ if (sizeof($list)==0)
+ {
+ echo _("Nothing found");
+ } else
+ {
+
+ echo "<table border=\"0\" cellspacing=\"1\" ".
+ "cellpadding=3 bgcolor=\"#000000\" width=\"90%\">\n";
+ echo "<tr><th bgcolor=\"#CCCCFF\" align=\"left\" width=\"10%\">"._("Builder").
+ "[<a href=\"$big_url&ns=2\">"._("sort")."</a>]</th>";
+ echo "<th bgcolor=\"#CCCCFF\" align=\"left\" width=\"60%\">"._("Log File").
+ "[<a href=\"$big_url&ns=1\">"._("sort")."</a>]</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>";
+
+ function cmp1($f1, $f2) {
+ global $ftp_conn, $root_directory, $local;
+ if ($local)
+ 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[0]);
+ list($p21,$p22,$p23)=explode("_",$f2[0]);
+ return strcmp($f1[0],$f2[0]);
+ }
+
+ if ($ns == 1)
+ {
+ usort($list, "cmp1");
+// } else if ($ns == 2)
+// {
+// uksort($list, "cmp2");
+ } else
+ {
+ asort($list);
+ }
+
+ $counter=0;
+ while (list($k,$name)=each($list))
+ {
+ if (($counter<$off) || ($counter>$off+$cnt-1))
+ {
+ $counter++;
+ continue;
+ }
+
+ $counter++;
+ list($i,$j,$k)=explode("_",$k);
+ $filename = $name[0];
+
+ $h = bin2hex(mhash(MHASH_MD5, $filename));
+ $f = preg_replace("/.*\/([^\/]*)$/", "\\1", $filename);
+ $f = preg_replace("/\.(bz2|gz)$/", "", $f);
+ if ($local) {
+ $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]);
+ }
+ $t /= 60;
+ if ($t >= 60) {
+ $t /= 60;
+ if ($t >= 24) {
+ $t /= 24;
+ $t = round($t);
+ $t = $t . " " . ngettext("day","days",$t);
+ } else {
+ $t = round($t);
+ $t = $t . " " . ngettext("hour","hours",$t);
+ }
+ } else {
+ $t = round($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> ".
+ "[<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";
+ }
+ echo "</table></div>\n";
+
+ $backarr = "<<< ";
+ $back = _("Page back");
+ $forward = _("Page forward");
+ $forwardarr = " >>>";
+
+// FIXME
+/*
+ echo "<p><table width=\"90%\" align=\"center\"><tr><td align=left width=1%>";
+
+ if ($off > 0) {
+ $noff = $off - $cnt;
+ if ($noff < 0)
+ $noff = 0;
+ $hrefurl = "<a href=\"$big_url&off=$noff\">";
+ echo "$hrefurl$backarr</a></td><td align=left>$hrefurl$back</a>";
+ } else {
+ echo "$backarr</td><td align=left>$back";
+ }
+
+ echo "</td>\n<td align=\"center\">";
+ echo "</td>\n<td align=\"right\">";
+
+ if ($off + $cnt < count($list))
+ {
+ $noff = $off + $cnt;
+ if ($noff < 0)
+ $noff = 0;
+ $hrefurl = "<a href=\"$big_url&off=$noff\">";
+ echo "$hrefurl$forward</a></td><td align=\"right\" width=\"1%\">$hrefurl$forwardarr</a>";
+ }
+ else
+ {
+ echo "$forward</td><td align=\"right\" width=\"1%\">$forwardarr";
+ }
+
+ echo "</td>\n</tr></table></p>";
+*/
+ }
+ if ($local == 0)
+ {
+ ftp_quit($ftp_conn);
+ $ftp_conn = 0;
+ }
+ } else
+ {
+ echo _("Enter something!");
+ }
+ echo "</form>\n";
+}
+
function welcome()
{
?>
-<table border=0 width=100%><tr><td width=20%> </td><td>
-<h1>Zdrastwuj!</h1>
-<p>Welcome to PLD Build Logs WWW interface.</p><p>
-Feel free to email bug reports, complaints and feature requests
+<table border="0" width="100%"><tr><td width="20%"> </td><td>
+<h1><?=_("Welcome!")?></h1>
+<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:malekith /at/ pld-linux org">to us</a>. Positive opinions are also
-<a href="mailto:malekith /at/ pld-linux org">welcome</a> ;)</p>
-<p>Version: $Id: index.php,v 1.12 2002/06/21 13:13:35 ankry Exp $</p>
-</td><td width=20%> </td></tr>
+<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
}
//phpinfo();
if ($local) {
if ($action == "text") {
- local_dump_text();
+ dump_text();
+ } else if ($action == "adv_search") {
+ myheader();
+ adv_search();
+ trailer();
} else if ($action == "qatxt") {
dump_qa(1);
} else {
myheader();
- echo "<table cellpadding=10 width=100%><tr><td valign=top width=10%>";
+ echo "<table cellpadding=\"10\" width=\"100%\"><tr><td valign=\"top\" width=\"10%\">";
list_archs();
- echo "</td><td valign=top>";
+ echo "</td><td valign=\"top\">";
flush();
if ($action == "qa")
dump_qa(0);
else if ($action == "sqa")
search_qa();
else if (isset($id))
- local_dump_log($action == "tail");
+ dump_log($action == "tail");
else if (isset($idx))
- local_list_logs();
+ list_logs();
else
welcome();
echo "</td></tr></table>";
dump_qa(1);
} else {
myheader();
- echo "<table cellpadding=10 width=100%><tr><td valign=top width=10%>";
+ echo "<table cellpadding=\"10\" width=\"100%\"><tr><td valign=top width=\"10%\">";
list_archs();
- echo "</td><td valign=top>";
+ echo "</td><td valign=\"top\">";
flush();
if ($action == "qa")
dump_qa(0);