aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfuzzyray <fuzzyray@gentoo.org>2009-05-07 21:49:29 +0000
committerfuzzyray <fuzzyray@gentoo.org>2009-05-07 21:49:29 +0000
commitef3a54c29ee628e7807154d14eaa867b15e89368 (patch)
treea4d548aacc508638611c01efdb741b2c1a1dd897 /src
parentAdd patch from antarus: Run pychecker over everything, fix obvious things lik... (diff)
downloadgentoolkit-ef3a54c29ee628e7807154d14eaa867b15e89368.tar.gz
gentoolkit-ef3a54c29ee628e7807154d14eaa867b15e89368.tar.bz2
gentoolkit-ef3a54c29ee628e7807154d14eaa867b15e89368.zip
Add patch from Robert Buchholz: Respect count attribute in GLSA-2, based on a patch by Michael A. Smith in https://bugs.gentoo.org/218312
svn path=/branches/gentoolkit-0.2.4/; revision=621
Diffstat (limited to 'src')
-rw-r--r--src/glsa-check/glsa.py20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/glsa-check/glsa.py b/src/glsa-check/glsa.py
index 3574856..ffe6594 100644
--- a/src/glsa-check/glsa.py
+++ b/src/glsa-check/glsa.py
@@ -480,7 +480,23 @@ class Glsa:
self.title = getText(myroot.getElementsByTagName("title")[0], format="strip")
self.synopsis = getText(myroot.getElementsByTagName("synopsis")[0], format="strip")
self.announced = getText(myroot.getElementsByTagName("announced")[0], format="strip")
- self.revised = getText(myroot.getElementsByTagName("revised")[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 (revisedEl.attributes.has_key("count")):
+ count = revisedEl.getAttribute("count")
+ elif (self.revised.find(":") >= 0):
+ (self.revised, count) = self.revised.split(":")
+
+ try:
+ self.count = int(count)
+ except ValueError:
+ # TODO should this rais a GlsaFormatException?
+ self.count = 1
# now the optional and 0-n toplevel, #PCDATA tags and references
try:
@@ -537,7 +553,7 @@ class Glsa:
outstream.write((width*"=")+"\n")
outstream.write(wrap(self.synopsis, width, caption="Synopsis: ")+"\n")
outstream.write("Announced on: %s\n" % self.announced)
- outstream.write("Last revised on: %s\n\n" % self.revised)
+ outstream.write("Last revised on: %s : %02d\n\n" % (self.revised, self.count))
if self.glsatype == "ebuild":
for k in self.packages.keys():
pkg = self.packages[k]