".
- "";
+ "";
}
function end_pre()
@@ -279,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: | ".
@@ -293,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!")));
}
@@ -319,13 +338,12 @@ function dump_log($tail)
}
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
@@ -340,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();
+
?>
@@ -362,7 +475,7 @@ function dump_log($tail)
[=_("Back to list of logs")?>]
- [">=_("View rpm -qa of builder")?>]
|
@@ -383,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 {
@@ -413,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 "";
@@ -430,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.13 $'.
+ '$Revision: 1.37 $'.
" \n";
# smile ;)
@@ -441,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",
@@ -488,11 +605,7 @@ function get_qa()
if (!isset($dist) || !isset($arch))
return false;
- if($dist!='ti'){
- $addr = "http://ftp.pld-linux.org/dists/$dist/.stat/builder/$dist/rpmqa-$arch.txt";
- }else{
- $addr = "http://ftp.pld-linux.org/branches/titanium/.stat/builder/$dist/rpmqa-$arch.txt";
- }
+ $addr = "http://ftp1.pld-linux.org/dists/$dist/.stat/builder/$dist/rpmqa-$arch.txt";
return fopen("$addr", "r");
}
@@ -509,10 +622,15 @@ function search_qa()
echo _("Sorry, cannot open.");
} else {
while (($s = fgets($f, 1000)) != false) {
+ if (stristr($s, "Query done at:")) {
+ echo "rpmqa database from " . strstr($s, ":") . "\n";
+ continue;
+ }
+
if (stristr($s, $str))
echo $s;
}
- echo "/* EOF */";
+ echo "\n/* EOF */";
}
end_pre();
}
@@ -524,7 +642,7 @@ function dump_qa($plain)
$f = get_qa();
if ($plain) {
- header("Content-type: text/plain");
+ header("Content-type: text/plain");
echo _("# rpm -qa of")." $dist/$arch\n";
} else {
echo ""._("rpm -qa of")." $a";
@@ -686,7 +804,7 @@ function adv_search()
break;
}
$query .= " LIMIT $cnt OFFSET $off ";
-
+
try {
$dbh = new PDO("$database");
} catch (PDOException $e) {
@@ -804,9 +922,8 @@ function welcome()
=_("Welcome to PLD Build Logs WWW interface.")?>
=_("Feel free to email bug reports, complaints and feature requests ")?>
-=_("to us")?>. =_("Positive opinions are also")?>
-=_("welcome")?> ;)
-Version: $Id: index.php,v 1.13 2010/05/23 17:03:07 adamg Exp $
+=_("to us")?>. =_("Positive opinions are also")?>
+ =_("welcome")?> ;)
|
|