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

Bug#727048: PTS: Please show warning for "auto-removal from testing"



Control: tags -1 patch

Hi,

On Mon, Oct 21, 2013 at 10:22:37PM +0200, Niels Thykier wrote:
> Please warn maintainers about pending auto-removals from testing
> that affect their package(s).  The data set is available via [1].

The attached patches should add this information to the PTS.

Cheers,

Ivo


>From de4549e5a4aecbf966bc2721cde3c8fe5ae653aa Mon Sep 17 00:00:00 2001
From: Ivo De Decker <ivo.dedecker@ugent.be>
Date: Sat, 25 Jan 2014 22:21:50 +0100
Subject: [PATCH 1/2] download testing autoremoval info

---
 www/bin/update_incoming.sh | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/www/bin/update_incoming.sh b/www/bin/update_incoming.sh
index 4adbadf..e3a2575 100755
--- a/www/bin/update_incoming.sh
+++ b/www/bin/update_incoming.sh
@@ -211,6 +211,9 @@ get http://dedup.debian.net/static/ptslist.txt dedup.txt
 
 nice_redirect_to upstream-info.txt svn ls -R svn://anonscm.debian.org/collab-qa/packages-metadata
 
+# testing autoremoval info
+get https://udd.debian.org/cgi-bin/autoremovals.yaml.cgi autoremovals.yaml
+
 # What more ?
 
 # Decompress all files
-- 
1.8.5.3

>From 44e12a416152c0f9f757f1cf39da62ab243a59d3 Mon Sep 17 00:00:00 2001
From: Ivo De Decker <ivo.dedecker@ugent.be>
Date: Sun, 26 Jan 2014 01:38:43 +0100
Subject: [PATCH 2/2] display autoremoval info

---
 www/bin/other_to_xml.py | 56 +++++++++++++++++++++++++++++++++++++++++++-
 www/xsl/pts.xsl         | 62 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 117 insertions(+), 1 deletion(-)

diff --git a/www/bin/other_to_xml.py b/www/bin/other_to_xml.py
index acd74ce..e98686e 100755
--- a/www/bin/other_to_xml.py
+++ b/www/bin/other_to_xml.py
@@ -16,6 +16,7 @@ except ImportError: import json
 from lxml import html
 import xml.dom
 import re
+from datetime import datetime
 
 try:
     from debian import deb822, debian_support
@@ -321,6 +322,13 @@ def read_l10n_status(fname):
         f.close()
     return l10n
 
+def read_autoremoval_info(fname):
+    y = yaml.load(file(fname), yaml.CLoader)
+    packages = {} # maps pkg to the font review for it
+    if y:
+        packages = y
+    return packages
+
 # Initialization: fill binary <-> source maps
 f = open(odir + "/sources_mapping")
 source2binaries = cPickle.load(f) # maps a source package to its binaries
@@ -492,6 +500,9 @@ logcheck = read_logcheck_info(os.path.join(dir, "logcheck.txt"))
 # read clang build info
 clang = read_clang_info(os.path.join(dir, "clang.txt"))
 
+# read autoremoval info
+autoremovals = read_autoremoval_info(os.path.join(dir, "autoremovals.yaml"))
+
 # read the list of packages indexed by svnbuildstat.debian.net
 svnbuildstat = {}
 try:
@@ -1010,6 +1021,49 @@ while 1:
         root_elt.setAttribute('security', '0')
         sec_sig = '0'
 
+    # add autoremoval info
+    if autoremovals.has_key(pkg):
+        autoremoval_info = autoremovals[pkg]
+        elt = doc.createElement("autoremoval")
+        if len(autoremoval_info["bugs"]) > 0:
+            elt.setAttribute("bugs","yes")
+            for bug in autoremoval_info["bugs"]:
+                bug_elt = doc.createElement("bug")
+                bug_elt.setAttribute("bugid",bug)
+                elt.appendChild(bug_elt)
+        if autoremoval_info.has_key("bugs_dependencies"):
+            elt.setAttribute("bugs_dep","yes")
+            for bug in autoremoval_info["bugs_dependencies"]:
+                bug_elt = doc.createElement("bug_dep")
+                bug_elt.setAttribute("bugid",bug)
+                elt.appendChild(bug_elt)
+        if autoremoval_info.has_key("buggy_dependencies"):
+            elt.setAttribute("buggy_dep","yes")
+            for dep in autoremoval_info["buggy_dependencies"]:
+                bug_elt = doc.createElement("buggy_dep")
+                bug_elt.setAttribute("pkg",dep)
+                elt.appendChild(bug_elt)
+        if autoremoval_info.has_key("rdeps"):
+            elt.setAttribute("rdep","yes")
+            for rdep in autoremoval_info["rdeps"]:
+                bug_elt = doc.createElement("rdep")
+                bug_elt.setAttribute("pkg",rdep)
+                elt.appendChild(bug_elt)
+        removaldate = "on " + autoremoval_info["removal_date"].strftime("%Y-%m-%d")
+        if autoremoval_info["removal_date"] < datetime.now():
+            removaldate = "today"
+
+        elt.setAttribute("removaldate",removaldate)
+        elt.setAttribute("version",autoremoval_info["version"])
+
+        root_elt.appendChild(elt)
+        root_elt.setAttribute("autoremoval", "yes")
+        autoremoval_sig = autoremoval_info
+    else:
+        root_elt.setAttribute("autoremoval", "no")
+        autoremoval_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, dehs_sig,
@@ -1019,7 +1073,7 @@ while 1:
             watchbroken_sig, watchavail_sig, depneedsmaint_sig, dms_sig,
             fonts_sig, sec_sig, logcheck_sig, rg_sig, url_issues_sig,
             screenshots_sig, clang_sig, dedup_sig, longdesc_sig,
-            upstream_info_sig)
+            upstream_info_sig, autoremoval_sig)
     if sigs.has_key(pkg) and sig == sigs[pkg] and \
             os.path.isfile("%s/%s/%s/other.xml" % (odir, hash, pkg)):
         continue
diff --git a/www/xsl/pts.xsl b/www/xsl/pts.xsl
index 395f894..64b8b03 100644
--- a/www/xsl/pts.xsl
+++ b/www/xsl/pts.xsl
@@ -1286,6 +1286,67 @@ other-to-%xx, especially % to %25... Fortunately, that's rare -->
   </xsl:if>
 </xsl:template>
 
+<xsl:template name="autoremoval-status">
+  <xsl:if test="$other/@autoremoval='yes'">
+    <div class="block autoremoval">
+      <a name="autoremoval" />
+      <h2>autoremoval from testing</h2>
+      <ul>
+        <li>
+        Version <xsl:value-of select="$other/autoremoval/@version"/> of <xsl:value-of select="$package"/> is marked for autoremoval from testing
+        <xsl:value-of select="$other/autoremoval/@removaldate"/>.
+        </li>
+        <xsl:if test="$other/autoremoval/@bugs='yes'">
+          <li>
+            It is affected by RC bug(s)
+            <xsl:for-each select="$other/autoremoval/bug">
+              <xsl:if test="position()=last()"><xsl:text> and </xsl:text>
+              </xsl:if>
+              <xsl:if test="position()!=last() and position() != 1"><xsl:text>, </xsl:text>
+              </xsl:if>
+              <a href="http://bugs.debian.org/{@bugid}";><xsl:value-of select="@bugid"/></a>
+            </xsl:for-each>
+          </li>
+        </xsl:if>
+        <xsl:if test="$other/autoremoval/@buggy_dep='yes'">
+          <li>
+            It depends (transitively) on
+            <xsl:for-each select="$other/autoremoval/buggy_dep">
+              <xsl:if test="position()=last()"><xsl:text> and </xsl:text>
+              </xsl:if>
+              <xsl:if test="position()!=last() and position() != 1"><xsl:text>, </xsl:text>
+              </xsl:if>
+              <a href="/{@pkg}"><xsl:value-of select="@pkg"/></a>
+            </xsl:for-each>,
+            affected by RC bug(s)
+            <xsl:for-each select="$other/autoremoval/bug_dep">
+              <xsl:if test="position()=last()"><xsl:text> and </xsl:text>
+              </xsl:if>
+              <xsl:if test="position()!=last() and position() != 1"><xsl:text>, </xsl:text>
+              </xsl:if>
+              <a href="http://bugs.debian.org/{@bugid}";><xsl:value-of select="@bugid"/></a>
+            </xsl:for-each>
+          </li>
+        </xsl:if>
+        <xsl:if test="$other/autoremoval/@rdep='yes'">
+          <li>
+            The removal of <xsl:value-of select="$package"/> will also cause the removal of
+            (transitive) reverse dependencies:
+            <ul>
+              <xsl:for-each select="$other/autoremoval/rdep">
+              <li><a href="/{@pkg}"><xsl:value-of select="@pkg"/></a>
+              </li>
+              </xsl:for-each>
+            </ul>
+          </li>
+        </xsl:if>
+      <li>You should try to prevent the removal from testing by fixing these bugs.
+      </li>
+      </ul>
+    </div>
+  </xsl:if>
+</xsl:template>
+
 <xsl:template name="testing-status">
   <xsl:if test="$hasexcuse or $other/@transitions='yes'">
     <div class="block testing">
@@ -1442,6 +1503,7 @@ other-to-%xx, especially % to %25... Fortunately, that's rare -->
 	    <div class="center maincol">
 	      <xsl:call-template name="todo-list" />
 	      <xsl:call-template name="problems" />
+	      <xsl:call-template name="autoremoval-status" />
 	      <xsl:call-template name="testing-status" />
 	      <xsl:call-template name="static-info" />
 	      <xsl:call-template name="latest-news" />
-- 
1.8.5.3


Reply to: