".
- "";
+ "";
}
function end_pre()
@@ -276,10 +293,15 @@ function dump_log($tail)
$df = preg_replace("/.*\/([^\/]*)$/", "\\1", $f);
$df = preg_replace("/\.(bz2|gz)$/", "", $df);
+ list($name, $id) = explode(',', $df);
- echo "$df";
+ if ($name != 'command') {
+ $gitweb_url = "http://git.pld-linux.org/?p=packages/$name.git;a=summary";
+ $name = "$name";
+ }
+ echo "$name $id";
- echo " ";
+ echo "";
function one_item($h, $t) {
echo "$h: | ".
@@ -290,21 +312,21 @@ function dump_log($tail)
return "$c";
}
- one_item(_("Status"), ($ok == 1 ?
- ""._("OK")."" :
+ one_item(_("Status"), ($ok == 1 ?
+ ""._("OK")."" :
""._("Failed").""));
- one_item(_("Source URL"),
- href("ftp://$buildlogs_server/$f",
+ one_item(_("Source URL"),
+ href("ftp://$buildlogs_server/$f",
"ftp://$buildlogs_server/$f"));
$big_url = "$url?dist=$dist&arch=$arch&ok=$ok&ns=$ns&cnt=$cnt";
$bu = "$big_url&off=$off";
- one_item(_("text/plain URL"),
+ one_item(_("text/plain URL"),
href("$bu&name=$name_url&id=$id&action=text",
_("View!")));
if ($tail) {
- one_item(_("full text"),
+ one_item(_("full text"),
href("$bu&name=$name_url&id=$id",
_("View!")));
}
@@ -314,15 +336,14 @@ function dump_log($tail)
} else {
one_item(_("rpm -qa of builder"), _("Not available"));
}
- one_item("Data", date("Y/m/d H:i:s", filemtime("$root_directory/$f")));
+ one_item("Date", date("Y/m/d H:i:s", filemtime("$root_directory/$f")));
/*
- echo "Here: | " .
+ echo " | Here: | " .
"".
"http://" . getenv("SERVER_NAME") .
getenv("SCRIPT_NAME") . "?idx=$idx&ok=$ok&id=$id" .
" | "; */
- echo " "._("Content:")."";
# what can I say beside PHP suxx? how the fuck should I create
@@ -337,21 +358,116 @@ function dump_log($tail)
}
$cmd = "$filter '$root_directory/$f'";
- if ($tail)
- $cmd = "$cmd | tail -n 100";
$fd = popen($cmd, "r");
- start_pre();
+ $toc = array();
+ $err = array();
+ $first_cut = false;
+ $first_cut_done = false;
+ $time = "";
+ $out_buf = array();
+ $out_buf_size = 0;
while (($s = fgets($fd, 102400)) != false) {
- if (strlen($s) > 800) {
- $s = chunk_split($s, 800, "\n ");
- $s = trim($s);
- }
+
+ $toc_elem = false;
+ $err_elem = false;
+
$s = htmlspecialchars($s);
- echo $s;
+ // highlight errors
+ if (preg_match("/(?:fail|error(s|\sCS\d+)?):/i", $s)) {
+ $first_cut = true;
+ $err_count++;
+ $toc_elem = "error $err_count";
+ $err_elem = $s;
+ $s = "$s";
+ } elseif (preg_match("/(?:undefined reference to|recipe for target '.*?' failed)/i", $s)) {
+ $first_cut = true;
+ $err_count++;
+ $toc_elem = "error $err_count";
+ $err_elem = $s;
+ $s = "$s";
+ } elseif (preg_match("#^\+ /usr/bin/make\b.*\b(?Pcheck)\b#", $s, $m)) {
+ // rpm build section
+ $toc_elem = "make {$m['target']}";
+ $err_elem = $s;
+ $s = "$s";
+ } elseif (preg_match('/^(?P- For complete changelog see:) (?P.+)$/', $s, $m)) {
+ // rpm changelog link
+ $link = "{$m['link']}";
+ $s = "{$m['line']} $link ";
+ } elseif (preg_match('/^(?P\* \w{3} \w{3} [ \d]{2} \d{4} .*?) (?P[a-z0-9]{7})$/', $s, $m)) {
+ // rpm changelogs
+ $url = "http://git.pld-linux.org/?p=packages/{$name_url}.git;a=commitdiff;h={$m['hash']}";
+ $link = "{$m['hash']}";
+ $s = "{$m['line']} $link ";
+ } elseif (substr($s, 0, 2) == "+ ") {
+ // shell verbose
+ $s = "$s";
+ } elseif (preg_match("/^Executing\(%(?P\w+)\)/", $s, $m)) {
+ // rpm build section
+ $toc_elem = $m['section'];
+ $err_elem = $s;
+ $s = "$s";
+ } elseif (preg_match("/^Processing files: (?P(?P.+)-[^-]+-[^-]+)/", $s, $m)) {
+ $first_cut = true;
+ // processing files
+ $toc_elem = "files ".$m['name'];
+ $err_elem = $s;
+ $s = "$s";
+ } elseif (preg_match("/^ended at: (?P.+), done in (?P ";
+
+ if (!empty($toc)) {
+ echo ""._("Toc:")."";
+ echo "";
+ foreach ($toc as $i => $section) {
+ $id = str_replace(" ", "-", $section);
+ echo "- {$section}
";
+ echo "{$err[$i]} ";
+ }
+ echo " ";
+ }
+
+ echo ""._("Content:")."";
+
+ start_pre();
+ echo $code;
+ end_pre();
+
?>
@@ -359,7 +475,7 @@ function dump_log($tail)
[=_("Back to list of logs")?>]
- [">=_("View rpm -qa of builder")?>]
|
@@ -380,11 +496,14 @@ function dump_text()
return;
echo "# src : ftp://$buildlogs_server/$f\n";
- echo "# date : " .
+ echo "# date : " .
date("Y/m/d H:i:s", filemtime("$root_directory/$f")) . "\n";
if (preg_match("/\.bz2$/", $f)) {
- $filter = "bzcat";
+ if (is_executable("/usr/bin/lbzcat"))
+ $filter = "lbzcat";
+ else
+ $filter = "bzcat";
} elseif (preg_match("/\.gz$/", $f)) {
$filter = "zcat";
} else {
@@ -410,16 +529,17 @@ function list_archs()
echo "\n";
echo ""._("Failed")." | "._("Ok")." | \n";
- foreach ($addr as $dist => $ddist) {
- foreach ($ddist as $arch) {
- echo "".
- "
- $dist/$arch | ".
- "[OK] | ".
- #"[qa] | ".
- " \n";
- }
- }
+ foreach ($addr as $dist => $ddist) {
+ echo "
| \n";
+ foreach ($ddist as $arch) {
+ echo "".
+ "
+ $dist/$arch | ".
+ "[OK] | ".
+ #"[qa] | ".
+ " \n";
+ }
+ }
echo " \n";
echo "";
@@ -427,10 +547,10 @@ function list_archs()
echo " main()
\n";
echo " \n" .
- " (c) 2002 ".
+ "alt=\""._("Powered by PLD Linux")."\" border=\"0\" /> \n" .
+ "(c) 2002-". date("Y") . " ".
"PLD Team \n".
- '$Revision: 1.2 $'.
+ '$Revision: 1.37 $'.
" \n";
# smile ;)
@@ -438,10 +558,10 @@ function list_archs()
$pow = array("vim", "php", "brain", "power", "electricity",
"coffee", "ufo", "penguin", "GNOME", "ELF", "DWARF",
"voodoo magic", "Linux", "x-files", "X", "foobar",
- "/dev/null", "/dev/zero", "/dev/drzewo",
+ "/dev/null", "/dev/zero", "/dev/drzewo",
"Leppe'", "matrix", "Neo", "PDP-11",
"Ken", "GNU antilope", "PDP-7", "ITS", "Multics",
- "foobarbaz", "ed", "Joe", "Unix conspiracy",
+ "foobarbaz", "ed", "Joe", "Unix conspiracy",
"overclock", "The Right Thing",
"The Bad Thing", "Star Treck", "NSA", "NASA",
"achelon", "VAX", "Real Programmer",
@@ -451,7 +571,7 @@ function list_archs()
"Paranoid Android", "Lunatic Corp", "Parallel thinking",
"sfistak", "Linus", "The Golden Path", "Dark Side of the Force",
"Przewodniczacego Lepper-a", "KDE", "Microsoft Windows 2003", "sqlite3",
- "synergy"
+ "synergy", "six Cray XMT Supercomputers"
# feel free to add sth if you change this file ;)
);
echo _("Powered by")." ";
@@ -464,8 +584,12 @@ function list_archs()
}
echo "";
+ echo "";
+ echo "Your IP: " . $_SERVER['REMOTE_ADDR'];
+ echo " ";
+
if (isset($dist) && isset($arch)) {
- echo " |