[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#261111: qa.debian.org: Dehs data integration in developer.wml



Followup-For: Bug #206363
Package: qa.debian.org
Tags: Patch

This patch close this bug and introduces some dehs[1] data in
developer.wml.

Databases needed and daily updated are here: 
http://alioth.debian.org/debian_qa_unstable.db
http://alioth.debian.org/debian_qa_experimental.db

and must to go in /org/qa.debian.org/data/dehs (wget this files in a
cronjob?). 

Cheers,
Stefano Fabri

[1] http://dehs.alioth.debian.org
--- developer.wml	2004-07-21 17:14:30.000000000 +0200
+++ developer_dehs.wml	2004-07-23 21:08:10.000000000 +0200
@@ -30,7 +30,6 @@
     text-decoration: none;
 }
 </style>
-
 <?
 error_reporting(0);
 $time = microtime();
@@ -137,7 +136,14 @@
 <small>
 <b>Packages in <font color="blue">blue</font> are packages that are co-maintained by developer (reference to Uploaders: field)</b><br>
 <b>Packages version in <font color="red">red</font> are NMUed</b><br>
-<b>Packages where testing version in <font color="#ff00ff">magenta</font> are those where the unstable version differs from the version in testing</b><br><br>
+<b>Packages where testing version in <font color="#ff00ff">magenta</font> are those where the unstable version differs from the version in testing</b><br>
+<b>Packages where Upstream/Wwiz version in <font color="green">green</font> are those where the upstream finded version is in sync with version unstable/experimental</b><br>
+<b>Packages where Upstream/Wwiz version in <font color="#ff00ff">magenta</font> are those where the upstream finded version is greater than version in unstable</b><br>
+<b>Packages where Upstream/Wwiz version in <font color="#2222AA">navy blue</font> are those where the upstream finded version is lower than version in unstable (a bug in the Watch file)</b><br>
+<b>Packages where Upstream/Wwiz is <font color="red">error</font> are those where the uscan had problems following the Watch file</b><br>
+<b>Packages where Upstream is N/A are those that doesn't had a Watch file</b><br>
+<b>Packages where Wwiz is N/A are those that doesn't had a Copyright file for trying to automatically generate a Watch file</b><br>
+<b>Packages where Wwiz is <font color="red">notmatch</font> are those that had a Copyright file but no useful url download link was found for trying to automatically generate a Watch file</b><br><br>
 <b><u>The real number of bugs is displayed in each bugs column.
 If there are any merged bugs, the total is displayed within parenthesis.</u></b>
 </small>
@@ -310,7 +316,86 @@
     return substr($package_name, 0, 1);
   }
 }
-
+# Begin of Dehs functions
+function dehsdb_conn ($dbname,$mode) {
+	$id = dba_open($dbname, $mode, "db2");
+	if (!$id) {
+		echo "dba_open failed\n";
+   		exit;
+	}
+return $id;
+}
+function dehsdb_xml($xml) {
+	$p = xml_parser_create();
+	xml_parse_into_struct($p, $xml, $vals, $index);
+	xml_parser_free($p);
+	$values=array("id"=>$vals[1][value],"up_version"=>$vals[2][value],"wwiz"=>$vals[3][value]);
+	return $values;
+}
+function dehs_value($pkg_name,$dist) {
+	$id = dehsdb_conn("/org/qa.debian.org/data/dehs/dehs_qa_" . $dist . ".db","r");
+    if (!dba_exists($pkg_name,$id)) return array("id"=>"-","up_version"=>"-","wwiz"=>"-");
+	$xml=dba_fetch($pkg_name,$id);
+	dba_close($id);
+	return dehsdb_xml($xml);
+}
+function vers_conv($debvers) {
+	preg_match("/(.+:)?(.+)(ds-|-)/",$debvers,$matches);
+	return $matches[2];
+}
+function ver_comp($a,$b) {
+	exec("dpkg --compare-versions '$a' gt '" . vers_conv($b) . "'",$output,$res);
+	if ($res==0) return 1;
+	exec("dpkg --compare-versions '$a' lt '" . vers_conv($b) . "'",$output,$res);
+	if ($res==0) return 2;
+	else return 3;
+}
+function print_dehs($package,$version,$dist,$type) {
+	$dehs_values=dehs_value($package,$dist);
+	if ($type=="up_version") {
+		$dehs_link='<small><a href="http://dehs.alioth.debian.org/maintainer.php?name=' . rawurlencode($package) . '"> Details</a></small>';
+  		if($dehs_values[up_version]=="-") {
+    		$dehs_values[up_version] = '<small>-</small>';
+			$dehs_link='';
+  		}
+  		elseif ($dehs_values[up_version]=='N/A') {
+  			$color="black";
+		}	
+  		elseif ($dehs_values[up_version]=='Error') $color="red";
+  		elseif(ver_comp($dehs_values[up_version],$version)==1) $color="magenta";	
+  		elseif(ver_comp($dehs_values[up_version],$version)==2) $color="#2222AA";
+  		else {
+  			$color="green"; 
+  			$dehs_link='';
+  		}
+  		$upstream_print = '<td rowspan="1" colspan="1"><small><font color="' . $color . '">' . $dehs_values[up_version] . '</font>' . $dehs_link . '</small></td>';
+		return $upstream_print;
+	}	
+	else {	
+  		$wwiz_link_desc="Details";
+  		if($dehs_values[wwiz]=='-' or !$dehs_values[wwiz]) {
+    		$dehs_values[wwiz] = '<small>-</small>';
+			$dehs_link='';
+  		}
+  		elseif ($dehs_values[wwiz]=='N/A') $color="black";
+  		elseif ($dehs_values[wwiz]=='error' OR $dehs_values[wwiz]=='notmatch') $color="red";
+  		elseif(ver_comp($dehs_values[wwiz],$version)==1) {
+  			$color="magenta";
+			$wwiz_link_desc="Watch";
+		}
+  		elseif(ver_comp($dehs_values[wwiz],$version)==2) {
+  			$color="#2222AA";
+			$wwiz_link_desc="Watch";
+		}	
+  		else {
+  			$color="green"; 
+  			$wwiz_link_desc="Watch";
+  		}
+		if(!isset($dehs_link)) {$dehs_link='<small><a href="http://dehs.alioth.debian.org/wwiz_detail.php?id=' . $dehs_values[id] . '&type=watch"> ' . $wwiz_link_desc . '</small></a>';}
+  		$wwiz_print= '<td rowspan="1" colspan="1"><small><font color="' . $color . '">' . $dehs_values[wwiz] . '</font>' . $dehs_link . '</small></td>';
+		return $wwiz_print;
+  	}
+}
 # Check whether there is a debcheck entry for that package
 function debcheckavailable($branch, $package_name) {
   $package = ereg_replace ("\.", "_", $package_name);
@@ -359,7 +444,7 @@
 <tr align="center">
 <th rowspan="2"><small><font color="green">Source&nbsp;Name</font></small></th>
 <th rowspan="1" colspan="5"><small><font color="green">Bugs(see above)</font></small></th>
-<th rowspan="1" colspan="5"><small><font color="green">Version</font></small></th>
+<th rowspan="1" colspan="9"><small><font color="green">Version</font></small></th>
 <th rowspan="1" colspan="2"><small><font color="green">Security</font></small></th>
 <th rowspan="2"><small><font color="green">Binary<br> Package Page</font></small></th>
 <th rowspan="2"><small><font color="green">Buildd</font></small></th>
@@ -379,8 +464,12 @@
 <th><small><font color="green">Stable</font></small></th>
 <th><small><font color="green">Testing</font></small></th>
 <th><small><font color="green">Unstable</font></small></th>
+<th><small><font color="green">Upstream Uns.</font></small></th>
+<th><small><font color="green">WWiz Up. Uns.</font></small></th>
 <th><small><u><font color="green"><span title="Stable Proposed updates">Prop. Up.</span></font></u></small></th>
 <th><small><font color="green">Exp.</font></small></th>
+<th><small><font color="green">Upstream Exp.</font></small></th>
+<th><small><font color="green">WWiz Up. Exp.</font></small></th>
 <th><small><font color="green">Stable</font></small></th>
 <th><small><font color="green">Testing</font></small></th>
 <th><small><font color="green">Stable</font></small></th>
@@ -421,6 +510,7 @@
   $version_unstable = $versions[2];
   $version_prop = $versions[3];
   $version_experimental = $versions[4];
+  $version_experimental_backup= $versions[4];
   $security_stable = $versions[5];
   $security_testing = $versions[6];
   $uninstalable_stable = preg_replace("/,/", "&nbsp;", $results[3]);
@@ -469,7 +559,7 @@
     $excuse .= "<a href=\"http://bjorn.haxx.se/debian/testing.pl?package=$package\";>More</a>";
   }else{
     $excuse = "-";
-  }
+  } 
   if(strcmp($version_prop, "-")) {
     $version_prop = '<font color="#2222AA"><b>' . $version_prop . '</b></font>';
   }
@@ -483,9 +573,9 @@
   if((strcmp ($version_stable, $version_testing) == 0) && 
      (strcmp ($version_stable, "/") != 0)) {
      if((strcmp ($version_unstable, $version_testing) == 0)) {
-    $version_print = '<td rowspan="1" colspan="3"><small>' . $version_stable . '</small></td>' .$prop .$experimental;
+    $version_print = '<td rowspan="1" colspan="3"><small>' . $version_stable . '</small></td>' .print_dehs($package,$version_unstable,"unstable","up_version") .print_dehs($package,$version_unstable,"unstable","wwiz") . $prop . $experimental . print_dehs($package,$version_experimental_backup,"experimental","up_version") .print_dehs($package,$version_experimental_backup,"experimental","wwiz");
     }else{
- 	$version_print = '<td rowspan="1" colspan="2"><small><font color="#ff00ff">' . $version_stable . '</font></small></td><td rowspan="1" colspan="1"><small>' . $version_unstable . '</small></td>' . $prop .$experimental;
+ 	$version_print = '<td rowspan="1" colspan="2"><small><font color="#ff00ff">' . $version_stable . '</font></small></td><td rowspan="1" colspan="1"><small>' . $version_unstable . '</small></td>' .print_dehs($package,$version_unstable,"unstable","up_version") .print_dehs($package,$version_unstable,"unstable","wwiz") . $prop . $experimental . print_dehs($package,$version_experimental_backup,"experimental","up_version") .print_dehs($package,$version_experimental_backup,"experimental","wwiz");
     }
     $ver = explode("-", $version_unstable);
     if((preg_match("/(.+\..+?)$/", $ver[count($ver) - 1], $toto)) && (count($ver) != 1))
@@ -496,7 +586,7 @@
     if(strcmp($version_stable, "/") != 0) {
       $version_stable = '<font color="#00AADD">'.$version_stable.'</font>';
     }
-    $version_print = '<td><small>'.$version_stable.'</small></td><td rowspan="1" colspan="2"><small>' . $version_testing .'</small></td>' .$prop . $experimental;
+    $version_print = '<td><small>'.$version_stable.'</small></td><td rowspan="1" colspan="2"><small>' . $version_testing .'</small></td>' . print_dehs($package,$version_unstable,"unstable","up_version") . print_dehs($package,$version_unstable,"unstable","wwiz") . $prop . $experimental . print_dehs($package,$version_experimental_backup,"experimental","up_version") .print_dehs($package,$version_experimental_backup,"experimental","wwiz");
     $ver = explode("-", $version_unstable);
     if((preg_match("/(.+\..+?)$/", $ver[count($ver) - 1], $toto)) && (count($ver) != 1))
         {
@@ -508,7 +598,7 @@
     }else{
       $version_stable = '<small>'.$version_stable.'</small>';
     }
-    $version_print = '<td>' . $version_stable . '</td><td><small><font color="#ff00ff">'.$version_testing . '</font></small></td><td><small>'.$version_unstable.'</small></td>' . $prop .$experimental;
+    $version_print = '<td>' . $version_stable . '</td><td><small><font color="#ff00ff">'.$version_testing . '</font></small></td><td><small>'.$version_unstable.'</small></td>' . print_dehs($package,$version_unstable,"unstable","up_version") .print_dehs($package,$version_unstable,"unstable","wwiz") . $prop . $experimental . print_dehs($package,$version_experimental_backup,"experimental","up_version") . print_dehs($package,$version_experimental_backup,"experimental","wwiz");
     $ver = explode("-", $version_unstable);
     if((preg_match("/(.+\..+?)$/", $ver[count($ver) - 1], $toto)) && (count($ver) != 1))
        {

Reply to: