]> git.pld-linux.org Git - projects/buildlogs.git/commitdiff
- added search of rpm -qa
authorMichal Moskal <michal@moskal.me>
Sat, 11 May 2002 14:15:08 +0000 (14:15 +0000)
committerMichal Moskal <michal@moskal.me>
Sat, 11 May 2002 14:15:08 +0000 (14:15 +0000)
obsolete/buildlogs/index.php

index 62f0886b329da01f43e159d6a5ecc09dc122f853..616008948d94d337e71bf442e8790e8a945ca220 100644 (file)
@@ -120,7 +120,7 @@ function open_ftp()
        }
 
        if (ftp_login($ftp, "anonymous", 
-                     "buildlogs-iface@pld.org.pl") == false) {
+                     "buildlogs-iface@pld-linux.org") == false) {
                ftp_quit($ftp);
                mydie("cannot ftp login to $buildlogs_server");
                return false;
@@ -713,7 +713,7 @@ function local_dump_text()
 
 function list_archs()
 {
-       global $addr, $url;
+       global $addr, $url, $idx;
 
        echo "<table width=100% border=0>\n";
        echo "<tr><td bgcolor=#cccccc nowrap=1>Failed</td><td bgcolor=#cccccc>Ok</td></tr>\n";
@@ -725,7 +725,7 @@ function list_archs()
                     "</tr>\n";
        echo "</table><hr />\n";
        echo "<div align=\"center\"><a href=\"$url\">main()</a><hr />\n";
-       echo "<a href=\"http://www.pld.org.pl/\"><img src=powpld.png ".
+       echo "<a href=\"http://www.pld-linux.org/\"><img src=powpld.png ".
                "alt=\"Powered by PLD Linux\" border=0></a><br />\n" .
             "<small>(c) 2002 ".
             "<a href=\"mailto:feedback@pld.org.pl\">PLD&nbsp;Team</a>\n".
@@ -759,17 +759,64 @@ function list_archs()
        }
                
        echo "</small></div>";
+       
+       global $qa_addr;
+
+       if ($qa_addr[$idx] != "") {
+       echo "<form action=\"index.php\" method=\"post\">";
+       echo "<input type=hidden name=idx value=$idx />";
+       echo "<input type=hidden name=action value=sqa />";
+       echo "<input type=text size=14 name=str /><br/>";
+       echo "<input type=submit name=submit value=\"Search rpmqa!\" />";
+       echo "</form>";
+       }
+
 }
 
-function dump_qa($plain)
+function get_qa()
 {
-       global $url, $idx, $qa_addr, $qa_base;
+       global $idx, $qa_addr, $qa_base;
        
        if (!isset($idx) || !isset($qa_addr[$idx]))
                return false;
 
        $a = $qa_addr[$idx];
        
+       if ($qa_addr[$idx] == "")
+               return false;
+       else
+               return fopen("$qa_base$qa_addr[$idx]", "r");
+}
+
+function search_qa()
+{
+       global $url, $idx, $qa_addr, $str;
+
+       $f = get_qa();
+       echo "<h1>Search results for '$str' in $qa_addr[$idx]</h1>";
+
+       start_pre();
+
+       if ($f == 0) {
+               echo "Sorry, cannot open.";
+       } else {
+               while (($s = fgets($f, 1000)) != false) {
+                       if (stristr($s, $str))
+                               echo $s;
+               }
+               echo "/* EOF */";
+       }
+       end_pre();
+}
+
+function dump_qa($plain)
+{
+       global $url, $idx, $qa_addr;
+       
+       $a = $qa_addr[$idx];
+
+       $f = get_qa();
+       
        if ($plain) {
                header("Content-type: text/plain"); 
                echo "# rpm -qa of $a\n";
@@ -780,16 +827,12 @@ function dump_qa($plain)
                start_pre();
        }
 
-       if ($qa_addr[$idx] == "") {
-               echo "Sorry... not found.";
+       if ($f == 0) {
+               echo "Sorry, cannot open.";
        } else {
-               $f = fopen("$qa_base$qa_addr[$idx]", "r");
-               if ($f == 0) {
-                       echo "Sorry, cannot open $qa_base$qa_addr[$idx]";
-               } else
-                       while (($s = fgets($f, 1000)) != false) {
-                               echo $s;
-                       }
+               while (($s = fgets($f, 1000)) != false) {
+                       echo $s;
+               }
        }
        
        if (!$plain)
@@ -804,9 +847,9 @@ function welcome()
 <p>Welcome to PLD Build Logs WWW interface.</p><p>
 Feel free to email bug reports, complaints and feature requests 
 <!-- ech... niech strace... -->
-<a href="mailto:malekith (at) pld org pl">to us</a>. Positive opinions are also 
-<a href="mailto:malekith (at) pld org pl">welcome</a> ;)</p>
-<p>Version: $Id: index.php,v 1.7 2002/05/04 19:23:30 kloczek Exp $</p>
+<a href="mailto:malekith /at/ pld-linux org">to us</a>. Positive opinions are also 
+<a href="mailto:malekith /at/ pld-linux org">welcome</a> ;)</p>
+<p>Version: $Id: index.php,v 1.8 2002/05/11 13:51:18 malekith Exp $</p>
 </td><td width=20%>&nbsp;</td></tr>
 </table>
 <?php
@@ -831,6 +874,8 @@ if ($local) {
                flush();
                if ($action == "qa")
                        dump_qa(0);
+               else if ($action == "sqa")
+                       search_qa();
                else if (isset($id))
                        local_dump_log($action == "tail");
                else if (isset($idx))
This page took 0.712526 seconds and 4 git commands to generate.