]> git.pld-linux.org Git - projects/buildlogs.git/blobdiff - index.php
Space between words. Drop CVS id.
[projects/buildlogs.git] / index.php
index c200de34a939f9f33861075e735fc7dbe703353b..11558cdd43afdb0079b6bad379cc4e0a931def1e 100644 (file)
--- a/index.php
+++ b/index.php
@@ -110,6 +110,9 @@ TH { font-family: arial,helvetica,sans-serif;
        color: #111;
        background-color: #161;
 }
+.changelog a {
+       color: #fff;
+}
 //-->
 </style>
  </head>
@@ -290,10 +293,15 @@ function dump_log($tail)
 
        $df = preg_replace("/.*\/([^\/]*)$/", "\\1", $f);
        $df = preg_replace("/\.(bz2|gz)$/", "", $df);
+       list($name, $id) = explode(',', $df);
 
-       echo "<h1>$df</h1>";
+       if ($name != 'command') {
+               $gitweb_url = "http://git.pld-linux.org/?p=packages/$name.git;a=summary";
+               $name = "<a href=\"$gitweb_url\">$name</a>";
+       }
+       echo "<h1>$name <small>$id</small></h1>";
 
-       echo "<table border=\"0\" cellpadding=\"3\" cellspacing=\"1\" bgcolor=\"#000000\" width="\100%\">";
+       echo "<table border=\"0\" cellpadding=\"3\" cellspacing=\"1\" bgcolor=\"#000000\" width=\"100%\">";
 
        function one_item($h, $t) {
                echo "<tr><td bgcolor=\"#ccccff\">$h:</td>".
@@ -360,11 +368,6 @@ function dump_log($tail)
        $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;
 
@@ -376,7 +379,7 @@ function dump_log($tail)
                        $toc_elem = "error $err_count";
                        $err_elem = $s;
                        $s = "<span class=error id=error-$err_count>$s</span>";
-               } 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";
@@ -387,6 +390,15 @@ function dump_log($tail)
                        $toc_elem = "make {$m['target']}";
                        $err_elem = $s;
                        $s = "<span class=line id=make-{$m['target']}>$s</span>";
+               } elseif (preg_match('/^(?P<line>- For complete changelog see:) (?P<link>.+)$/', $s, $m)) {
+                       // rpm changelog link
+                       $link = "<a href=\"{$m['link']}\">{$m['link']}</a>";
+                       $s = "<span class=changelog>{$m['line']} $link<br/></span>";
+               } elseif (preg_match('/^(?P<line>\* \w{3} \w{3} [ \d]{2} \d{4} .*?) (?P<hash>[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 = "<a href=\"$url\">{$m['hash']}</a>";
+                       $s = "<span class=changelog>{$m['line']} $link<br/></span>";
                } elseif (substr($s, 0, 2) == "+ ") {
                        // shell verbose
                        $s = "<span class=verbose>$s</span>";
@@ -488,7 +500,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 +529,17 @@ function list_archs()
 
        echo "<table width=\"100%\" border=\"0\">\n";
        echo "<tr><td bgcolor=\"#cccccc\" nowrap=\"nowrap\">"._("Failed")."</td><td bgcolor=\"#cccccc\">"._("Ok")."</td></tr>\n";
-  foreach ($addr as $dist => $ddist) {
-    foreach ($ddist as $arch) {
-               echo "<tr><td nowrap=\"nowrap\">".
-                    "<a href=\"$url?dist=$dist&amp;arch=$arch&amp;ok=0&amp;cnt=$cnt\">
-             $dist/$arch</a></td><td nowrap=\"nowrap\">".
-                    "[<a href=\"$url?dist=$dist&amp;arch=$arch&amp;ok=1&amp;cnt=$cnt\">OK</a>]</td>".
-                    #"<td>[<a href=\"$url?idx=$i&amp;action=qa\">qa</a>]</td>".
-                    "</tr>\n";
-    }
-  }
+       foreach ($addr as $dist => $ddist) {
+               echo "<tr><td colspan=2 nowrap=\"nowrap\"><hr/></td></tr>\n";
+               foreach ($ddist as $arch) {
+                       echo "<tr><td nowrap=\"nowrap\">".
+                               "<a href=\"$url?dist=$dist&amp;arch=$arch&amp;ok=0&amp;cnt=$cnt\">
+                               $dist/$arch</a></td><td nowrap=\"nowrap\">".
+                               "[<a href=\"$url?dist=$dist&amp;arch=$arch&amp;ok=1&amp;cnt=$cnt\">OK</a>]</td>".
+                               #"<td>[<a href=\"$url?idx=$i&amp;action=qa\">qa</a>]</td>".
+                               "</tr>\n";
+               }
+       }
        echo "</table><hr />\n";
        
        echo "<div align=\"center\">";
@@ -534,7 +550,7 @@ function list_archs()
             "alt=\""._("Powered by PLD Linux")."\" border=\"0\" /></a><br />\n" .
             "<small>(c) 2002-". date("Y") . " ". 
             "<a href=\"mailto:feedback@pld-linux.org\">PLD&nbsp;Team</a><br />\n".
-            '$Revision: 1.33 $'.
+            '$Revision: 1.37 $'.
             "</small></div>\n";
 
        # smile ;)
@@ -907,8 +923,7 @@ function welcome()
 <?=_("Feel free to email bug reports, complaints and feature requests ")?>
 <!-- ech... niech strace... -->
 <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.33 2014/10/18 10:14:28 arekm Exp $</p>
+ <a href="mailto:feedback@pld-linux.org"><?=_("welcome")?></a> ;)</p>
 </td><td width="20%">&nbsp;</td></tr>
 </table>
 <?php
This page took 0.07058 seconds and 4 git commands to generate.