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

Re: The PTS should list Ubuntu patches



On Mon, Jul 18, 2005 at 05:44:09PM +0200, Raphaël Hertzog wrote:
> Hello,
> 
> to improve integration of Ubuntu patches into Debian we need to make
> maintainers aware of their existence. So they need to be mentionned in
> the PTS.
[cut]

attached there is the preliminary patch against current cvs for adding a new
column "Patches" on the left.
Right now only ubuntu's and bts' patches are listed, however adding another
source for patches should be fairly easy.
IMO it should be useful to have the debian version to which the patch applies,
however figuring that out from ubuntu's requires some black magic that I don't
get. (maybe extracting from the path in the diff header? scott?)

filippo
--
Filippo Giunchedi
PGP key: 0x6B79D401
random quote follows:

It's not that I'm afraid to die, I just don't want to be there
when it happens.
-- Woody Allen
--- bin/other_to_xml.py	19 Jul 2005 22:09:15 -0000	1.16
+++ bin/other_to_xml.py	21 Jul 2005 18:03:58 -0000
@@ -108,6 +108,22 @@
     watch = cPickle.load(f)
     f.close()
 
+# Read patches information [FG]
+patches = {}
+# this can be easily inserted into update_patches.py it becomes too heavy to
+# parse the file
+if os.path.exists(dir + "/patches.ubuntu"):
+    f = open(dir + "/patches.ubuntu")
+    for line in f.readlines():
+        (package, rel_url) = line.split(' ', 2)
+        rel_url = rel_url.strip()
+        r = re.search("_(\S+).patch", line)
+        if not r:
+            continue
+        version = r.group(1)
+        patches[package] = {}
+        patches[package]['ubuntu'] = (version, "http://people.ubuntu.com/~scott/patches/"; + rel_url)
+
 # Create the XML documents
 while 1:
     line = sys.stdin.readline()
@@ -250,11 +266,27 @@
         root_elt.setAttribute("watch", "no")
         watch_sig = "n"
         
+    # Add patches informations [FG]    
+    if patches.has_key(pkg):
+        elt = doc.createElement("patches")
+        for distro in patches[pkg].keys():
+           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)
         
+        root_elt.appendChild(elt)
+        root_elt.setAttribute("patches", "yes")
+        patch_sig = len(patches[pkg].keys()) 
+    else:
+        root_elt.setAttribute("patches", "no")
+        patch_sig = "n"
 
     # 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, watch_sig, s_rc, s_normal, s_wishlist, s_fixed, subsig)
+    sig = (pts.get(pkg, "0"), dc_sig, wnpp_sig, override_sig, watch_sig, patch_sig, s_rc, s_normal, s_wishlist, s_fixed, subsig)
     if sigs.has_key(pkg) and sig == sigs[pkg] and \
             os.path.isfile("%s/%s/%s/other.xml" % (odir, hash, pkg)):
         continue
--- bin/update_incoming.sh	8 Jun 2005 01:28:46 -0000	1.23
+++ bin/update_incoming.sh	21 Jul 2005 18:03:58 -0000
@@ -90,6 +90,9 @@
 # Get wnpp information
 nice_wget http://qa.debian.org/data/bts/wnpp_rm wnpp_rm
 
+# get patches from ubuntu
+nice_wget http://people.ubuntu.com/~scott/patches/PATCHES patches.ubuntu
+
 # What more ?
 
 # Decompress all files
--- xsl/pts.xsl	19 Jul 2005 22:45:04 -0000	1.47
+++ xsl/pts.xsl	21 Jul 2005 18:10:56 -0000
@@ -425,7 +425,7 @@
   </tr>
   </xsl:if>
  
-  <!-- unstablej -->
+  <!-- unstable -->
   <xsl:if test="$hasunstable">
   <tr class="normalrow">
   <td class="labelcell">Unstable</td>
@@ -444,6 +444,29 @@
   </td>
   </tr>
   </xsl:if>
+
+  <!-- Patches list [FG] -->
+  <xsl:if test="$other/@patches='yes'">
+    <tr class="titlerow">
+    <td class="titlecell" colspan="2">
+    Patches
+    </td></tr>
+    <tr>
+    <td class="contentcell" colspan="2" style="text-align: left">
+    <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>
+      </li>
+    </xsl:for-each>
+    <xsl:if test="$other/bugs/@patch!='0'">
+      <li>
+        <a href="http://bugs.debian.org/cgi-bin/pkgreport.cgi?which=src&amp;data={$package}&amp;include=patch&amp;exclude=pending";>Patches from BTS (<xsl:value-of select="$other/bugs/@patch"/>)</a>
+      </li>
+    </xsl:if>
+    </td>
+    </tr>
+  </xsl:if> 
+
 
   <tr class="titlerow">
   <td class="titlecell" colspan="2">

Attachment: signature.asc
Description: Digital signature


Reply to: