[Dehs-devel] r126 - in trunk: . www

atomo64-guest at alioth.debian.org atomo64-guest at alioth.debian.org
Sat Apr 5 22:52:47 UTC 2008


Author: atomo64-guest
Date: 2008-04-05 22:52:46 +0000 (Sat, 05 Apr 2008)
New Revision: 126

Modified:
   trunk/dehs_pg.php
   trunk/www/maintainer.php
Log:
dehs_pg.php: correct popcon retrieval for source packages
www/maintainer_php: reorganize stuff

Modified: trunk/dehs_pg.php
===================================================================
--- trunk/dehs_pg.php	2008-03-24 17:56:53 UTC (rev 125)
+++ trunk/dehs_pg.php	2008-04-05 22:52:46 UTC (rev 126)
@@ -427,12 +427,12 @@
     while ($res_array=pg_fetch_array($rsql)) {
         $package = $res_array['name'];
 
-        if (!dba_exists('p:' .  $package, $popcon_db)) {
+        if (!dba_exists('si:' .  $package, $popcon_db)) {
             continue;
         }
 
-        $inst = dba_fetch("pi:$package", $popcon_db);
-        $vote = dba_fetch("pv:$package", $popcon_db);
+        $inst = dba_fetch("si:$package", $popcon_db);
+        $vote = dba_fetch("sv:$package", $popcon_db);
 
         @pg_exec($db, "UPDATE pkgs SET pop_inst='$inst',pop_vote='$vote' WHERE name='$package'");
     }

Modified: trunk/www/maintainer.php
===================================================================
--- trunk/www/maintainer.php	2008-03-24 17:56:53 UTC (rev 125)
+++ trunk/www/maintainer.php	2008-04-05 22:52:46 UTC (rev 126)
@@ -55,16 +55,49 @@
 $maint = pg_escape_string($maint);
 $name  = pg_escape_string($name);
 
-$sql=ARRAY(no_watch=>"SELECT id,pkgs.pop_inst,name,pkgs.version,pkgs.dist,tot_up_error, tot_avg_error_date,wwiz,wwiz_type,wwiz_version,maint,section,up_changes,up_url,dversionmangled,lastupvsdebsync,lastcheck FROM pkgs INNER JOIN
+?>
+<center><table bgcolor="#BBDDFF" border="0" cellpadding="0" cellspacing="0" summary="">
+  <tr>
+        <td colspan="3" valign="top">
+          <img src="http://www.debian.org/Pics/blue-upperleft.png" align="left" border="0" hspace="0" vspace="0" alt="" width="8" height="8">
+          <img src="http://www.debian.org/Pics/blue-upperright.png" align="right" border="0" hspace="0" vspace="0" alt="" width="8" height="8">
+        </td>
+  </tr>
+  <tr>
+        <td>&nbsp;</td>
+        <td valign="top" class="smallsserif">
+<div style="text-align: center;font-family: Arial, Helvetica, sans-serif;font-size: 90%;">
+    <div>
+        <a href="#no_watch">Pkgs without watch file</a> |
+        <a href="#no_updated">Pkgs not in sync with upstream</a>
+    </div>
+    <div>
+        <a href="#no_upstream">Pkgs with watch file but no upstream version checkable</a> |
+        <a href="#ok">Pkgs up to date</a>
+    </div>
+</div></td>
+  <td>&nbsp;</td>
+  </tr>
+  <tr>
+        <td colspan="3" valign="bottom">
+          <img src="http://www.debian.org/Pics/blue-lowerleft.png" align="left" border="0" hspace="0" vspace="0" alt="" width="8.5" height="8">
+          <img src="http://www.debian.org/Pics/blue-lowerright.png" align="right" border="0" hspace="0" vspace="0" alt="" width="8" height="8">
+        </td>
+  </tr>
+  </table></center><br/>
+<?php
+
+$sql=ARRAY(no_updated=>"Select id,pkgs.pop_inst,name,section,version,tot_up_error,tot_avg_error_date,pkgs.dist,up_version,watch_warn, up_changes,up_url,dversionmangled,lastupvsdebsync,lastcheck from pkgs
+INNER join (Select SUM(up_error) as tot_up_error,AVG(avg_error_date) as tot_avg_error_date,name,dist FROM binpkgs GROUP BY name,dist) as binpkgs using(name,dist)
+where updated='0' AND up_version!='' AND (maint LIKE '$maint' OR uploaders LIKE '%$maint%') AND name LIKE '$name'
+order by pop_inst desc;",
+no_upstream=>"select id,pkgs.pop_inst,name,section,version, tot_up_error, tot_avg_error_date, pkgs.dist,watch_warn,up_changes, up_version,up_url,dversionmangled,lastupvsdebsync,lastcheck  from pkgs INNER JOIN (Select SUM(up_error) as tot_up_error,AVG(avg_error_date) as tot_avg_error_date,name,dist FROM binpkgs GROUP BY name,dist)
+as binpkgs using(name,dist) where up_version='' AND watch!='' AND (maint LIKE '$maint' OR uploaders LIKE '%$maint%') AND name LIKE '$name' order by pop_inst desc;",
+no_watch=>"SELECT id,pkgs.pop_inst,name,pkgs.version,pkgs.dist,tot_up_error, tot_avg_error_date,wwiz,wwiz_type,wwiz_version,maint,section,up_changes,up_url,dversionmangled,lastupvsdebsync,lastcheck FROM pkgs INNER JOIN
 (Select SUM(up_error) as tot_up_error,AVG(avg_error_date) as tot_avg_error_date,name,dist FROM binpkgs GROUP BY name,dist) as binpkgs using(name,dist)
 WHERE (watch IS NULL OR watch='') AND (maint LIKE '$maint' OR uploaders LIKE '%$maint%') AND name LIKE '$name' ORDER BY pop_inst DESC;",
-no_upstream=>"select id,pkgs.pop_inst,name,section,version, tot_up_error, tot_avg_error_date, pkgs.dist,watch_warn,up_changes, up_version,up_url,dversionmangled,lastupvsdebsync,lastcheck  from pkgs INNER JOIN (Select SUM(up_error) as tot_up_error,AVG(avg_error_date) as tot_avg_error_date,name,dist FROM binpkgs GROUP BY name,dist)
-as binpkgs using(name,dist) where up_version='' AND watch!='' AND (maint LIKE '$maint' OR uploaders LIKE '%$maint%') AND name LIKE '$name' order by pop_inst desc;",
-no_updated=>"Select id,pkgs.pop_inst,name,section,version,tot_up_error,tot_avg_error_date,pkgs.dist,up_version,watch_warn, up_changes,up_url,dversionmangled,lastupvsdebsync,lastcheck from pkgs
+ok=>"Select id,pkgs.pop_inst,name,section,version,tot_up_error,tot_avg_error_date,pkgs.dist,up_version,watch_warn, up_changes,up_url,dversionmangled,lastupvsdebsync,lastcheck from pkgs
 INNER join (Select SUM(up_error) as tot_up_error,AVG(avg_error_date) as tot_avg_error_date,name,dist FROM binpkgs GROUP BY name,dist) as binpkgs using(name,dist)
-where updated='0' AND up_version!='' AND (maint LIKE '$maint' OR uploaders LIKE '%$maint%') AND name LIKE '$name'
-order by pop_inst desc;",ok=>"Select id,pkgs.pop_inst,name,section,version,tot_up_error,tot_avg_error_date,pkgs.dist,up_version,watch_warn, up_changes,up_url,dversionmangled,lastupvsdebsync,lastcheck from pkgs
-INNER join (Select SUM(up_error) as tot_up_error,AVG(avg_error_date) as tot_avg_error_date,name,dist FROM binpkgs GROUP BY name,dist) as binpkgs using(name,dist)
 where updated='1' AND (maint LIKE '$maint' OR uploaders LIKE '%$maint%') AND name LIKE '$name' AND (up_version != '' AND up_version IS NOT NULL)
 order by pop_inst desc;");
 foreach($sql as $key => $value) {
@@ -83,7 +116,7 @@
   <tr>
         <td>&nbsp;</td>
         <td valign="top" class="smallsserif">
-<p><big>&nbsp;&nbsp;<?php
+<p><a name="<?php print $key; ?>"><big>&nbsp;&nbsp;<?php
 		switch ($key) {
 			case "no_watch":
 				print "$totrs <b>packages without a watch file</b>, <b>share: </b> " . number_format ( $totrs/$totpkgs[0] * 100, 2) . "%<br>" ;
@@ -98,7 +131,7 @@
 				print "$totrs <b>packages up-to-date</b>, <b>share: </b> " . number_format ( $totrs/$totpkgs[0] * 100, 2) . "%<br>" ;
 				break;
 			} ?>
-</big></td>
+</big></a></td>
   <td>&nbsp;</td>
   </tr>
   <tr>
@@ -108,10 +141,16 @@
         </td>
   </tr>
   </table>
-<?
+<?php
+            $c = 0;
         	while ($res_array=pg_fetch_array($rs)) {
 
+        	    if (1 == $c) {
 ?>
+<table>
+<tr>
+<?php } ?>
+<td width="50%">
 <ul>
 <li><a name="<? print $res_array["name"]; ?>"><b>Name:</b> <a href="http://packages.qa.debian.org/<?=$res_array['name']?>"><? print $res_array["name"]; ?></a></a></li>
 <ul>
@@ -146,7 +185,7 @@
 ?>
 <li><b>Debian Version: </b><? print htmlentities($res_array["version"]);
 if ($res_array["dversionmangled"] != $res_array["version"]) {
-    echo '&nbsp;(mangled:&nbsp;<i>' . htmlentities($res_array["dversionmangled"]) . '</i>)';
+    echo ' <span style="white-space: nowrap;">(mangled:&nbsp;<i>' . htmlentities($res_array["dversionmangled"]) . '</i>)</span>';
 }
 ?></li>
 <li><b>Last time checked: </b><? echo htmlentities($res_array['lastcheck']); ?></li>
@@ -172,15 +211,31 @@
 <li><b>Copyright: </b><? print "<a href=" . htmlentities(changelog($res_array)) . ">" . "View</a>"; ?></li>
 </ul>
 </ul>
+</td>
 <hr>
-<?
-print "<!-- Machine-readable: " . $res_array['name'] . " " .
-       $res_array["version"] . " " .
-	   $res_array["up_version"]  . " " .
-       $res_array["wwiz_version"] . " -->";
-    } ?>
-<?
- }
+<?php
+        if (2 == $c) {
+?>
+</tr>
+</table>
+<hr>
+<?php   }
+
+        print "<!-- Machine-readable: " . $res_array['name'] . " " .
+        $res_array["version"] . " " .
+        $res_array["up_version"]  . " " .
+        $res_array["wwiz_version"] . " -->";
+
+//        $c = (1 == $c)? 2 : 1;
+
+        }
+        if (2 == $c) {
+            ?>
+            </tr>
+            </table>
+            <?php
+        }
+    }
 }
 	pg_close($db);
 




More information about the Dehs-devel mailing list