X-Git-Url: https://git.pld-linux.org/?a=blobdiff_plain;f=index.php;h=357a9f18736d8617d571d34d29eb1e415507718b;hb=aa0c7f70d7f9cd500e944be8cdafba253ed1c908;hp=6c04500a79d544ba6ff021e3e56be48b46aa85ce;hpb=007b0dfd2d7f35c23ad36c623e4210d8196849f8;p=projects%2Fbuildlogs.git diff --git a/index.php b/index.php index 6c04500..357a9f1 100644 --- a/index.php +++ b/index.php @@ -1,4 +1,7 @@ @@ -123,7 +130,7 @@ TH { font-family: arial,helvetica,sans-serif; function start_pre() { echo "
". - "
";
+		"
";
 }
 
 function end_pre()
@@ -290,10 +297,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 "". @@ -351,32 +363,29 @@ function dump_log($tail) $cmd = "$filter '$root_directory/$f'"; $fd = popen($cmd, "r"); - $line_idx = 0; - $processing_idx = 0; $toc = array(); $err = array(); - $err_count = 0; + $first_cut = false; + $first_cut_done = false; $time = ""; $out_buf = array(); $out_buf_size = 0; + $err_count = 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); // 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)/i", $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; @@ -386,6 +395,15 @@ function dump_log($tail) $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"; @@ -395,7 +413,7 @@ function dump_log($tail) $err_elem = $s; $s = "$s"; } elseif (preg_match("/^Processing files: (?P(?P.+)-[^-]+-[^-]+)/", $s, $m)) { - $processing_idx = $line_idx; + $first_cut = true; // processing files $toc_elem = "files ".$m['name']; $err_elem = $s; @@ -404,29 +422,28 @@ function dump_log($tail) $time = $m['time']; } - $out_buf[$line_idx] = $s; + $out_buf[] = $s; $out_buf_size++; // if error/processing found truncate early but keep last 100 lines before error - if ($tail && ($err_count == 1 || ($err_count == 0 && $processing_idx == $line_idx)) && $out_buf_size > 100) { + if ($tail && $first_cut && !$first_cut_done && $out_buf_size > 100) { array_splice($out_buf, 0, $out_buf_size - 100); $out_buf_size = 100; + $first_cut_done = true; } // if (not in tail mode) or (in tail mode but we have an error) - if (!$tail || $err_count || $processing_idx) { + if (!$tail || $first_cut) { if ($toc_elem) $toc[] = $toc_elem; if ($err_elem) $err[] = $err_elem; } - - $line_idx++; } pclose($fd); // no errors found, no processing found but we are in tail mode - if ($tail && $err_count == 0 && $processing_idx == 0 && $out_buf_size > 100) { + if ($tail && !$first_cut_done && $out_buf_size > 100) { array_splice($out_buf, 0, $out_buf_size - 100); $out_buf_size = 100; } @@ -488,7 +505,10 @@ function dump_text() 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 { @@ -514,16 +534,17 @@ function list_archs() echo "
$h:
\n"; echo "\n"; - foreach ($addr as $dist => $ddist) { - foreach ($ddist as $arch) { - echo "". - #"". - "\n"; - } - } + foreach ($addr as $dist => $ddist) { + echo "\n"; + foreach ($ddist as $arch) { + echo "". + #"". + "\n"; + } + } echo "
"._("Failed").""._("Ok")."
". - " - $dist/$arch". - "[OK][qa]

". + " + $dist/$arch". + "[OK][qa]

\n"; echo "
"; @@ -531,10 +552,10 @@ function list_archs() echo "main()
\n"; echo "
\n" . - "(c) ". date("Y") . " ". + "alt=\""._("Powered by PLD Linux")."\" border=\"0\" />
\n" . + "(c) 2002-". date("Y") . " ". "PLD Team
\n". - '$Revision: 1.28 $'. + '$Revision: 1.37 $'. "
\n"; # smile ;) @@ -606,10 +627,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(); } @@ -902,8 +928,7 @@ function welcome() . - ;)

-

Version: $Id: index.php,v 1.28 2014/10/12 22:38:52 arekm Exp $

+ ;)