Author: witekfl                      Date: Wed Oct 22 09:52:10 2008 GMT
Module: buildlogs                     Tag: HEAD
---- Log message:
- simpification. Not tested yet.

---- Files affected:
buildlogs/buildlogs.sql:
   buildlogs2.inc (1.1 -> 1.2) , index2.php (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: buildlogs/buildlogs.sql/buildlogs2.inc
diff -u buildlogs/buildlogs.sql/buildlogs2.inc:1.1 
buildlogs/buildlogs.sql/buildlogs2.inc:1.2
--- buildlogs/buildlogs.sql/buildlogs2.inc:1.1  Wed Oct 22 11:22:15 2008
+++ buildlogs/buildlogs.sql/buildlogs2.inc      Wed Oct 22 11:52:04 2008
@@ -3,24 +3,8 @@
 $database = "sqlite:$database_file";
 $root_directory = "/home/services/ftp/pub/pld-buildlogs";
 $addr = array(
-       array("dist" => "", "arch" => ""),/* must be first */
-       array("dist" => "th, "arch" => "SRPMS"),
-       array("dist" => "th", "arch" => "i486"),
-       array("dist" => "th", "arch" => "i686"),
-       array("dist" => "th", "arch" => "athlon"),
-       array("dist" => "th", "arch" => "x86_64"),
-       array("dist" => "th", "arch" => "alpha"),       
-       array("dist" => "th", "arch" => "ppc"),
-       array("dist" => "ac", "arch" => "SRPMS"),
-       array("dist" => "ac", "arch" => "i386"),
-       array("dist" => "ac", "arch" => "i586"),
-       array("dist" => "ac", "arch" => "i686"),
-       array("dist" => "ac", "arch" => "athlon"),
-       array("dist" => "ac", "arch" => "amd64"),
-       array("dist" => "ac", "arch" => "alpha"),       
-       array("dist" => "ac", "arch" => "ppc"),
-       array("dist" => "ac", "arch" => "sparc"),
-  array("dist" => "ac", "arch" => "sparc64")
+       "ac" => array("SRPMS", "i386", "i586", "i686", "alpha", "amd64", 
"athlon",
+    "ppc", "sparc", "sparc64"),
+  "th" => array("SRPMS", "i486", "i686", "alpha", "athlon", "ppc", "x86_64")
 );
-
 ?>

================================================================
Index: buildlogs/buildlogs.sql/index2.php
diff -u buildlogs/buildlogs.sql/index2.php:1.1 
buildlogs/buildlogs.sql/index2.php:1.2
--- buildlogs/buildlogs.sql/index2.php:1.1      Wed Oct 22 11:22:15 2008
+++ buildlogs/buildlogs.sql/index2.php  Wed Oct 22 11:52:04 2008
@@ -404,14 +404,16 @@
 
        echo "<table width=\"100%\" border=\"0\">\n";
        echo "<tr><td bgcolor=\"#cccccc\" 
nowrap=\"nowrap\">"._("Failed")."</td><td 
bgcolor=\"#cccccc\">"._("Ok")."</td></tr>\n";
-       for ($i = 1; $i < count($addr); $i++) {
-    $dist = $addr[$i]['dist'];
-    $arch = $addr[$i]['arch'];
+  foreach ($addr as $ddist) {
+    $dist = key($addr);
+    foreach ($ddist as $arch) {
                echo "<tr><td nowrap=\"nowrap\">".
-                    "<a 
href=\"$url?dist=$dist&amp;arch=$arch&amp;ok=0&amp;cnt=$cnt\">$addr[$i]</a></td><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";
        
@@ -579,12 +581,12 @@
   echo "<td>"._("OK")."</td>\n";
   echo "</tr>\n";
 
-  for ($i = 1; $i < count($addr); $i++)
-  {
+  $i = 1;
+  foreach ($addr as $ddist) {
+    $dist = key($addr);
+    foreach ($ddist as $arch) {
     echo "<tr>\n";
     $name="as0_".$i;
-    $dist = $addr[$i]['dist'];
-    $arch = $addr[$i]['arch'];
     if (!isset($_POST["$name"])) {
        $check = " ";
     } else {
@@ -599,6 +601,8 @@
     }
     echo "<td><input name=\"$name\" id=\"$name\" type=\"checkbox\"$check 
/><label for=\"$name\">".$dist/$arch."</label></td>\n";
     echo "</tr>\n";
+    $i++;
+    }
   }
        
   echo "<tr>\n";
@@ -640,13 +644,18 @@
        }
 
        $or = "AND (";
-       for ($i = 1; $i < count($addr); $i++) {
-               for ($j = 0; $j < 2; $j++) {
-                       if (isset($_POST["as" . $j . "_" .$i])) {
-                               $query .= "$or (dist = $addr[$i]['dist'] AND 
arch = $addr[$i]['arch'] AND ok = $j)";
+  $i = 1;
+  foreach ($addr as $ddist) {
+    $dist = key($addr);
+    foreach ($ddist as $arch) {
+      for ($j = 0; $j < 2; $j++) {
+                         if (isset($_POST["as" . $j . "_" .$i])) {
+                               $query .= "$or (dist = $dist AND arch = $arch 
AND ok = $j)";
                                $or = " OR ";
                        }
                }
+    $i++;
+    }
        }
        if ($or == " OR ") $query .= ")";
 //     if (!isset($cnt)) $cnt = 50;
================================================================

---- CVS-web:
    
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/buildlogs/buildlogs.sql/buildlogs2.inc?r1=1.1&r2=1.2&f=u
    
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/buildlogs/buildlogs.sql/index2.php?r1=1.1&r2=1.2&f=u

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to