Control: tag -1 patch On Sun, Nov 25, 2012 at 07:49:05PM +0000, Bart Martens wrote: > I have modified the PTS to no longer display the old DMUA flags. > http://anonscm.debian.org/viewvc/qa/trunk/pts/www/xsl/pts.xsl?r1=2868&r2=2867&pathrev=2868 > > At this point it is not visible on the PTS which DM has upload permission for > which package. Attached is a series of a patches that adds support for displaying DM information by each maintainer/uploader's name. As examples, I've also attached screenshots of what the "general" box looks like for the glx-alternatives (one DM uploader) and event-dance (DM maintainer) source packages. Cheers, -- James GPG Key: 4096R/331BA3DB 2011-12-05 James McCoy <jamessan@debian.org>
From 78c2c98cbfaa5466e930e5d9014443e177da64d3 Mon Sep 17 00:00:00 2001 From: James McCoy <vega.james@gmail.com> Date: Sun, 25 Nov 2012 22:08:11 -0500 Subject: [PATCH 1/5] Download dm.txt --- 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 c3334f6..ba14335 100755 --- a/www/bin/update_incoming.sh +++ b/www/bin/update_incoming.sh @@ -100,6 +100,9 @@ done get http://ftp-master.debian.org/testing/update_excuses.html.gz \ update_excuses.html.gz +# Download DM permissions +get http://ftp-master.debian.org/dm.txt dm.txt + # Download PTS subscription count get http://packages.qa.debian.org/data/pts-subscription-count.txt \ count.txt -- 1.7.10.4
From 5322c052f722b1a390cab94206f2f37676b65a33 Mon Sep 17 00:00:00 2001 From: James McCoy <vega.james@gmail.com> Date: Sun, 25 Nov 2012 22:08:35 -0500 Subject: [PATCH 2/5] Parse dm.txt into a data structure we can use --- www/bin/other_to_xml.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/www/bin/other_to_xml.py b/www/bin/other_to_xml.py index 84bbf2b..cc4ad2e 100755 --- a/www/bin/other_to_xml.py +++ b/www/bin/other_to_xml.py @@ -177,6 +177,23 @@ def read_NEW(fname): new_contents[stanza['source']] = stanza['version'] return new_contents +def read_dm(fname): + dm_contents = {} + for stanza in deb822.Deb822.iter_paragraphs(file(fname)): + if stanza.has_key('Uid') and stanza.has_key('Allow'): + # Allow is a comma-separated string of 'package (DD fpr)' items, + # where DD fpr is the fingerprint of the DD that granted the + # permission + name, email = stanza['Uid'].rsplit(' ', 1) + email = email.strip('<>') + for pair in stanza['Allow'].split(','): + pair = pair.strip() + pkg, dd_fpr = pair.split() + pkg = pkg.encode('utf-8') + dm_contents.setdefault(pkg, []) + dm_contents[pkg].append({'name': name, 'email': email}) + return dm_contents + def read_l10n_status(fname): l10n = {} if os.path.exists(fname): @@ -350,6 +367,7 @@ watchbroken = read_packages_list(os.path.join(dir, "watch-broken.txt")) watchavail = read_packages_list(os.path.join(dir, "watch-avail.txt")) new_queue = read_NEW(os.path.join(dir, "new.822")) +dms = read_dm(os.path.join(dir, 'dm.txt')) # read QA lintian info lintian = read_lintian_info(os.path.join(dir, "lintian.qa-list.txt")) -- 1.7.10.4
From 877b007d6685ce93b02d07ce35873f107c914919 Mon Sep 17 00:00:00 2001 From: James McCoy <vega.james@gmail.com> Date: Mon, 26 Nov 2012 21:21:30 -0500 Subject: [PATCH 3/5] Add dm information to XML and sig --- www/bin/other_to_xml.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/www/bin/other_to_xml.py b/www/bin/other_to_xml.py index cc4ad2e..798997e 100755 --- a/www/bin/other_to_xml.py +++ b/www/bin/other_to_xml.py @@ -463,7 +463,18 @@ while 1: new_queue_sig = 'y' else: new_queue_sig = 'n' - + + dms_sig = [] + elt = doc.createElement('dms') + # Add DM information + for dm in dms.get(pkg, []): + sub_elt = doc.createElement('item') + sub_elt.setAttribute('name', dm['name']) + sub_elt.setAttribute('email', dm['email']) + elt.appendChild(sub_elt) + dms_sig.append(dm) + root_elt.appendChild(elt) + # Get PTS stats elt = doc.createElement("pts") elt.setAttribute("count", pts.get(pkg, "0")) @@ -776,7 +787,7 @@ while 1: sig = (pts.get(pkg, "0"), dc_sig, wnpp_sig, override_sig, dehs_sig, ubuntu_sig, s_rc, s_normal, s_wishlist, s_fixed, s_gift, s_help, subsig, svnbuildstat_sig, transitions_sig, lintian_sig, - shortdesc_sig, piuparts_sig, new_queue_sig, i18n_sig, + shortdesc_sig, piuparts_sig, new_queue_sig, dms_sig, i18n_sig, watchbroken_sig, watchavail_sig, fonts_sig, sec_sig, logcheck_sig, rg_sig) if sigs.has_key(pkg) and sig == sigs[pkg] and \ -- 1.7.10.4
From 3a6f6f158e8905176689715b5d389bd37244bb98 Mon Sep 17 00:00:00 2001 From: James McCoy <vega.james@gmail.com> Date: Mon, 26 Nov 2012 22:10:11 -0500 Subject: [PATCH 4/5] Add indicate-dm template and use it to annotate the maintainer/uploaders --- www/xsl/pts.xsl | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/www/xsl/pts.xsl b/www/xsl/pts.xsl index 653dac5..e11db64 100644 --- a/www/xsl/pts.xsl +++ b/www/xsl/pts.xsl @@ -230,6 +230,21 @@ other-to-%xx, especially % to %25... Fortunately, that's rare --> </a> </xsl:template> +<xsl:template name="indicate-dm"> + <xsl:param name="email" /> + <xsl:param name="maintainer" /> + <xsl:if test="$hasother and $other/dms/item/@email=string($email)"> + <xsl:choose> + <xsl:when test="$maintainer"> + <xsl:text> (dm)</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>, dm</xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:if> +</xsl:template> + <xsl:template name="general-information"> <div class="block info"> <a name="general" /> @@ -271,6 +286,10 @@ other-to-%xx, especially % to %25... Fortunately, that's rare --> <xsl:value-of select="maintainer/name"/> </span> </xsl:element> + <xsl:call-template name="indicate-dm"> + <xsl:with-param name="email"><xsl:value-of select="maintainer/email"/></xsl:with-param> + <xsl:with-param name="maintainer">yes</xsl:with-param> + </xsl:call-template> <xsl:if test="uploaders"> <xsl:for-each select="uploaders/item"> <xsl:text>, </xsl:text> @@ -289,7 +308,12 @@ other-to-%xx, especially % to %25... Fortunately, that's rare --> <xsl:value-of select="name"/> </span> </xsl:element> - <xsl:text> (u)</xsl:text> + <xsl:text> (u</xsl:text> + <xsl:call-template name="indicate-dm"> + <xsl:with-param name="email"><xsl:value-of select="email"/></xsl:with-param> + <xsl:with-param name="maintainer"></xsl:with-param> + </xsl:call-template> + <xsl:text>)</xsl:text> </small> </span> </xsl:for-each> -- 1.7.10.4
From f13a39ab6da7bf8fa08dabd772e5a837f2075895 Mon Sep 17 00:00:00 2001 From: James McCoy <vega.james@gmail.com> Date: Mon, 26 Nov 2012 22:15:28 -0500 Subject: [PATCH 5/5] Remove old dm-upload-allowed support --- www/xsl/pts.xsl | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/www/xsl/pts.xsl b/www/xsl/pts.xsl index e11db64..93b3b2d 100644 --- a/www/xsl/pts.xsl +++ b/www/xsl/pts.xsl @@ -161,30 +161,15 @@ other-to-%xx, especially % to %25... Fortunately, that's rare --> <xsl:template name="add-maintenance-info"> <xsl:param name="email" /> - <xsl:variable name="dm"> - <xsl:if test="dm-upload-allowed and string(dm-upload-allowed)='yes'"> - <!-- <xsl:text>true</xsl:text> --> - </xsl:if> - </xsl:variable> <xsl:variable name="lownmu"> <xsl:if test="$low-nmu-emails/email[text()=$email]"> <xsl:text>true</xsl:text> </xsl:if> </xsl:variable> - <xsl:if test="string($dm)!='' or string($lownmu)!=''"> + <xsl:if test="string($lownmu)!=''"> <div class="maint-markers"> - <xsl:if test="string($dm)!=''"> - <span class="dm-tag"> - <a href="http://www.debian.org/vote/2007/vote_003"> - <acronym title="Debian Maintainer Upload Allowed: this package can be uploaded by Debian Maintainers">DMUA</acronym> - </a> - </span> - </xsl:if> <xsl:if test="string($lownmu)!=''"> - <xsl:if test="string($dm)!=''"> - <xsl:text>, </xsl:text> - </xsl:if> <span class="lownmu-tag"> <a href="http://wiki.debian.org/LowThresholdNmu"> <acronym title="maintainer agrees with Low Threshold NMU">LowNMU</acronym> -- 1.7.10.4
Attachment:
event-dance.jpg
Description: JPEG image
Attachment:
glx-alternatives.jpg
Description: JPEG image
Attachment:
signature.asc
Description: Digital signature