From e926de5088fc7f3d980b7633eae7382679a19175 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Wed, 21 Mar 2012 01:29:44 +0000 Subject: [PATCH] - hiliting for shell debug, rpmbuild sections; add toc for rpm build sections --- buildlogs.inc | 4 +--- index.php | 41 ++++++++++++++++++++++++++++++++++++----- 2 files changed, 37 insertions(+), 8 deletions(-) diff --git a/buildlogs.inc b/buildlogs.inc index ce5fcb0..273c544 100644 --- a/buildlogs.inc +++ b/buildlogs.inc @@ -5,8 +5,6 @@ $root_directory = "/home/services/ftp/pub/pld-buildlogs"; $addr = array( "ac" => array("SRPMS", "i386", "i586", "i686", "alpha", "amd64", "athlon", "ppc", "sparc", "sparc64"), - "th" => array("SRPMS", "i486", "i686", "alpha", "athlon", "ppc", "x86_64"), - "ti" => array("SRPMS", "i586", "i686", "x86_64"), - "ti-dev" => array("SRPMS", "i586", "i686", "x86_64") + "th" => array("SRPMS", "i486", "i686", "alpha", "athlon", "ppc", "x86_64") ); ?> diff --git a/index.php b/index.php index 8a688a2..74bb00b 100644 --- a/index.php +++ b/index.php @@ -103,6 +103,13 @@ TH { font-family: arial,helvetica,sans-serif; .error { background-color: #b00; } +.verbose { + color: #886; +} +.section { + color: #111; + background-color: #161; +} //--> @@ -329,7 +336,7 @@ function dump_log($tail) getenv("SCRIPT_NAME") . "?idx=$idx&ok=$ok&id=$id" . ""; */ - echo "

"._("Content:")."

"; + echo ""; # what can I say beside PHP suxx? how the fuck should I create @@ -347,7 +354,8 @@ function dump_log($tail) if ($tail) $cmd = "$cmd | tail -n 100"; $fd = popen($cmd, "r"); - start_pre(); + $toc = array(); + ob_start(); while (($s = fgets($fd, 102400)) != false) { if (strlen($s) > 800) { $s = chunk_split($s, 800, "\n "); @@ -357,11 +365,34 @@ function dump_log($tail) // highlight errors if (preg_match("/errors?:/i", $s)) { $s = "$s"; + } elseif (substr($s, 0, 2) == "+ ") { + // shell verbose + $s = "$s"; + } elseif (preg_match("/^Executing\(%(?P
\w+)\)/", $s, $m)) { + // rpm build section + $s = "$s"; + $toc[] = $m['section']; } echo $s; } - end_pre(); pclose($fd); + $code = ob_get_contents(); + ob_end_clean(); + + if (!empty($toc)) { + echo "

"._("Toc:")."

"; + echo ""; + } + + echo "

"._("Content:")."

"; + + start_pre(); + echo $code; + end_pre(); ?> @@ -441,7 +472,7 @@ function list_archs() "alt=\""._("Powered by PLD Linux")."\" border=\"0\" />
\n" . "(c) 2002 ". "PLD Team
\n". - '$Revision: 1.15 $'. + '$Revision: 1.16 $'. "
\n"; # smile ;) @@ -814,7 +845,7 @@ function welcome() . ;)

-

Version: $Id: index.php,v 1.15 2012/02/08 13:25:08 glen Exp $

+

Version: $Id: index.php,v 1.16 2012/02/08 21:03:01 glen Exp $