public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: bin/, pym/portage/
Date: Sat, 19 Jan 2013 05:00:30 +0000 (UTC)	[thread overview]
Message-ID: <1358571540.812c9ee0778547c0fb918ce4b62c7ba3957f6727.zmedico@gentoo> (raw)

commit:     812c9ee0778547c0fb918ce4b62c7ba3957f6727
Author:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
AuthorDate: Tue Mar  9 16:42:04 2010 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jan 19 04:59:00 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=812c9ee0

sync with genscripts rev 343. This adds the initial py3k support and the analyse utility to gentoolkit

svn path=/trunk/gentoolkit/; revision=751

http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=2f90a4b9ceff920f793541376da21d313af083d9

---
 bin/glsa-check      |    7 +++++++
 pym/portage/glsa.py |   13 +++++++------
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/bin/glsa-check b/bin/glsa-check
old mode 100644
new mode 100755
index 2b21d71..3d047b5
--- a/bin/glsa-check
+++ b/bin/glsa-check
@@ -142,6 +142,13 @@ for p in params[:]:
 glsalist.extend([g for g in params if g not in glsalist])
 
 def summarylist(myglsalist, fd1=sys.stdout, fd2=sys.stderr, encoding="utf-8"):
+	# Get to the raw streams in py3k before wrapping them with an encoded writer
+	# to avoid writing bytes to a text stream (stdout/stderr are text streams
+	# by default in py3k)
+	if hasattr(fd1, "buffer"):
+		fd1 = fd1.buffer
+	if hasattr(fd2, "buffer"):
+		fd2 = fd2.buffer
 	fd1 = codecs.getwriter(encoding)(fd1)
 	fd2 = codecs.getwriter(encoding)(fd2)
 	fd2.write(white("[A]")+" means this GLSA was marked as applied (injected),\n")

diff --git a/pym/portage/glsa.py b/pym/portage/glsa.py
index 155d3e5..c0c69dd 100644
--- a/pym/portage/glsa.py
+++ b/pym/portage/glsa.py
@@ -14,6 +14,7 @@ import re
 import operator
 import xml.dom.minidom
 from io import StringIO
+from functools import reduce
 
 import portage
 from portage import os
@@ -526,17 +527,17 @@ class Glsa:
 		self.synopsis = getText(myroot.getElementsByTagName("synopsis")[0], format="strip")
 		self.announced = format_date(getText(myroot.getElementsByTagName("announced")[0], format="strip"))
 
-		count = 1
 		# Support both formats of revised:
 		# <revised>December 30, 2007: 02</revised>
 		# <revised count="2">2007-12-30</revised>
 		revisedEl = myroot.getElementsByTagName("revised")[0]
 		self.revised = getText(revisedEl, format="strip")
-		if ((sys.hexversion >= 0x3000000 and "count" in revisedEl.attributes) or
-			(sys.hexversion < 0x3000000 and revisedEl.attributes.has_key("count"))):
-			count = revisedEl.getAttribute("count")
-		elif (self.revised.find(":") >= 0):
-			(self.revised, count) = self.revised.split(":")
+		count = revisedEl.attributes.get("count")
+		if count is None:
+			if self.revised.find(":") >= 0:
+				(self.revised, count) = self.revised.split(":")
+			else:
+				count = 1
 
 		self.revised = format_date(self.revised)
 


             reply	other threads:[~2013-01-19  5:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-19  5:00 Zac Medico [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-11-17 17:43 [gentoo-commits] proj/portage:master commit in: bin/, pym/portage/ Zac Medico
2013-11-29 23:24 Mike Frysinger
2013-06-25  7:48 Zac Medico
2013-06-23 22:57 Zac Medico
2013-06-23 22:40 Zac Medico
2013-02-11  9:39 Zac Medico
2013-01-19  5:16 Zac Medico
2013-01-19  3:23 Zac Medico
2013-01-19  3:23 Zac Medico
2013-01-19  2:27 Zac Medico
2013-01-19  1:53 Zac Medico
2012-10-18  0:05 Zac Medico
2012-03-17 16:44 Zac Medico
2012-03-11  1:40 Mike Frysinger
2011-12-08  7:26 Zac Medico
2011-06-17 22:35 Zac Medico
2011-06-04  1:39 Zac Medico
2011-02-20  0:00 Zac Medico

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1358571540.812c9ee0778547c0fb918ce4b62c7ba3957f6727.zmedico@gentoo \
    --to=zmedico@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox