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

Bug#483179: PTS: please link to Ubuntu Launchpad bugs page



tags 483179 + patch
thanks

On 27/05/08 at 18:41 +0200, Sandro Tosi wrote:
> Package: qa.debian.org
> Severity: wishlist
> 
> Hi all,
> it would be useful to have the link Launchpad (Ubuntu) page for the
> package bugs reported there: for example, for reportbug, a link to[1],
> in the box "Other links", or in a new one if support for external BTS
> will be added anytime soonen (but that's another story).
> 
> A really plus would be to have a launchpad bugs count; I don't know how
> easy this last point can be, maybe some support from Ubuntu would be
> needed.

Hi,

The attached patch removes the "patch" box, and adds an "Ubuntu" box,
with the following info:
- current version in Ubuntu
- if there's a patch available, link to the patch
- if there are open bugs, number of bugs

I'd like to stress that the goal of this is to allow Debian maintainers
to improve their packages by have an idea of the problems Ubuntu users
found. It's not to do Ubuntu developers' work. I don't expect Debian
maintainers to reply to bugs on launchpad.
-- 
| Lucas Nussbaum
| lucas@lucas-nussbaum.net   http://www.lucas-nussbaum.net/ |
| jabber: lucas@nussbaum.fr             GPG: 1024D/023B3F4F |
Index: www/xsl/pts.xsl
===================================================================
--- www/xsl/pts.xsl	(revision 1886)
+++ www/xsl/pts.xsl	(working copy)
@@ -634,35 +634,29 @@
   </xsl:if>
 </xsl:template>
 
-<xsl:template name="patches">
+<xsl:template name="ubuntu">
   <!-- Patches list [FG] -->
-  <xsl:if test="$other/@patches='yes'">
+  <xsl:if test="$other/@ubuntu='yes'">
     <tr class="titlerow">
       <td class="titlecell" colspan="2">
-	Patches
+	Ubuntu
     </td></tr>
     <tr>
       <td class="contentcell" colspan="2" style="text-align: left">
 	<ul>
-	  <xsl:for-each select="$other/patches/item">
 	    <li>
-	      <a href="{$other/patches/item/@url}">Patch from <xsl:value-of select="$other/patches/item/@distro"/> for version <xsl:value-of select="$other/patches/item/@version"/></a>
+		    Version: <a href="{$other/ubuntu/@url}"><xsl:value-of select="$other/ubuntu/@version"/></a>
 	    </li>
-	  </xsl:for-each>
-	  <xsl:if test="$other/bugs/@patch!='0'">
+	  <xsl:if test="$other/ubuntu/patch">
 	    <li>
-	      <xsl:element name="a">
-		<xsl:attribute name="href">
-		  <xsl:text>http://bugs.debian.org/cgi-bin/pkgreport.cgi?which=src&amp;data=</xsl:text>
-		  <xsl:call-template name="escape-name">
-		    <xsl:with-param name="text"><xsl:value-of select="$package"/></xsl:with-param>
-		  </xsl:call-template>
-		  <xsl:text>&amp;include=tags:patch&amp;exclude=tags:pending&amp;pend-exc=done</xsl:text>
-		</xsl:attribute>
-		Patches from BTS (<xsl:value-of select="$other/bugs/@patch"/>)
-	      </xsl:element>
+		    <a href="{$other/ubuntu/patch/@url}">Patch for version <xsl:value-of select="$other/ubuntu/patch/@version"/></a>
 	    </li>
 	  </xsl:if>
+	  <xsl:if test="$other/ubuntu/bugs">
+	    <li>
+		    <a href="{$other/ubuntu/bugs/@url}"><xsl:value-of select="$other/ubuntu/bugs/@count"/> open bugs</a>
+	    </li>
+	  </xsl:if>
 	</ul>
       </td>
     </tr>
@@ -1242,10 +1236,10 @@
     <xsl:call-template name="pts-subscription" />
   </table>
   <table class="lefttable">
-    <xsl:call-template name="patches" />
+    <xsl:call-template name="other-links" />
   </table>
   <table class="lefttable">
-    <xsl:call-template name="other-links" />
+    <xsl:call-template name="ubuntu" />
   </table>
   </td></tr>
   </table>
Index: www/bin/other_to_xml.py
===================================================================
--- www/bin/other_to_xml.py	(revision 1886)
+++ www/bin/other_to_xml.py	(working copy)
@@ -110,7 +110,7 @@
     f.close()
 
 # Read patches information [FG]
-patches = {}
+ubuntu_patches = {}
 # this can be easily inserted into a new update_patches.py if it becomes too
 # heavy to parse the file
 if os.path.exists(dir + "/patches.ubuntu"):
@@ -122,10 +122,27 @@
         if not r:
             continue
         version = r.group(1)
-        patches[package] = {}
-        patches[package]['ubuntu'] = (version, "http://patches.ubuntu.com/"; + rel_url)
+        ubuntu_patches[package] = (version, "http://patches.ubuntu.com/"; + rel_url)
     f.close()
 
+ubuntu_versions = {}
+if os.path.exists(dir + "/versions.ubuntu"):
+    f = open(dir + "/versions.ubuntu")
+    for line in f.readlines():
+        (package, version) = line.split(' ', 2)
+        version = version.strip()
+	ubuntu_versions[package] = (version, "https://launchpad.net/ubuntu/+source/"; + package)
+    f.close()
+
+ubuntu_bugs = {}
+if os.path.exists(dir + "/bugs.ubuntu"):
+    f = open(dir + "/bugs.ubuntu")
+    for line in f.readlines():
+        (package, count) = line.split('|', 2)
+        count = count.strip()
+	ubuntu_bugs[package] = (count, "https://bugs.launchpad.net/ubuntu/+source/"; + package)
+    f.close()
+
 # read low threshold NMU infos
 def read_low_threshold_nmu(fname):
     emails = []
@@ -326,25 +343,34 @@
     else:
         root_elt.setAttribute("override", "no")
 
-    # Add patches informations [FG]    
-    if patches.has_key(pkg):
-        elt = doc.createElement("patches")
-        patch_sig = ""
-        distros = patches[pkg].keys()
-        distros.sort()
-        for distro in distros:
-           child = doc.createElement("item")
-           (version, url) = patches[pkg][distro]
-           child.setAttribute("distro", unicode(distro, 'UTF8', 'replace'))
-           child.setAttribute("version", unicode(version, 'UTF8', 'replace'))
-           child.setAttribute("url", unicode(url, 'UTF8', 'replace'))
-           elt.appendChild(child)
-           patch_sig += "%s/%s " % (distro, version)
+    # Add Ubuntu information
+    if ubuntu_versions.has_key(pkg):
+        elt = doc.createElement("ubuntu")
+        (version, url) = ubuntu_versions[pkg]
+	ubuntu_sig = "ubuntu/ " + version
+        elt.setAttribute("version", unicode(version, 'UTF8', 'replace'))
+        elt.setAttribute("url", unicode(url, 'UTF8', 'replace'))
+    	if ubuntu_bugs.has_key(pkg):
+           elt.setAttribute("bugs", "yes")
+           elt_bugs = doc.createElement("bugs")
+           (count, url) = ubuntu_bugs[pkg]
+           ubuntu_sig += "ubuntubugs/" + count
+           elt_bugs.setAttribute("count", unicode(count, 'UTF8', 'replace'))
+           elt_bugs.setAttribute("url", unicode(url, 'UTF8', 'replace'))
+           elt.appendChild(elt_bugs)
+	if ubuntu_patches.has_key(pkg):
+           elt.setAttribute("patch", "yes")
+           elt_patch = doc.createElement("patch")
+           (version, url) = ubuntu_patches[pkg]
+           ubuntu_sig += "ubuntupatch/" + version
+           elt_patch.setAttribute("version", unicode(version, 'UTF8', 'replace'))
+           elt_patch.setAttribute("url", unicode(url, 'UTF8', 'replace'))
+           elt.appendChild(elt_patch)
         root_elt.appendChild(elt)
-        root_elt.setAttribute("patches", "yes")
+        root_elt.setAttribute("ubuntu", "yes")
     else:
-        root_elt.setAttribute("patches", "no")
-        patch_sig = "n"
+        root_elt.setAttribute("ubuntu", "no")
+        ubuntu_sig = "n"
 
     # Get DEHS information
     if dehs.has_key(pkg):
@@ -387,7 +413,7 @@
     # TODO: try to do that signature checking before the creation of XML DOM
     # Build the sig and check if anything changed
     sig = (pts.get(pkg, "0"), dc_sig, wnpp_sig, override_sig, dehs_sig,
-            patch_sig, s_rc, s_normal, s_wishlist, s_fixed, subsig,
+            ubuntu_sig, s_rc, s_normal, s_wishlist, s_fixed, subsig,
             svnbuildstat_sig, transitions_sig)
     if sigs.has_key(pkg) and sig == sigs[pkg] and \
             os.path.isfile("%s/%s/%s/other.xml" % (odir, hash, pkg)):
Index: www/bin/update_incoming.sh
===================================================================
--- www/bin/update_incoming.sh	(revision 1886)
+++ www/bin/update_incoming.sh	(working copy)
@@ -93,6 +93,10 @@
 
 # get patches from ubuntu
 nice_wget http://patches.ubuntu.com/PATCHES patches.ubuntu
+# get packages version in Ubuntu (preprocessed by Lucas on merkel)
+nice_wget http://qa.debian.org/~lucas/ubuntu/sources-versions.txt versions.ubuntu
+# get bugs in Ubuntu (preprocessed by Lucas on merkel)
+nice_wget http://qa.debian.org/~lucas/ubuntu/ubuntu-bugs.txt bugs.ubuntu
 
 # download LowThresholdNmu list
 nice_wget 'http://wiki.debian.org/LowThresholdNmu?action=raw' \

Reply to: