Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o, Aaron Bauman <bman@g.o>
Subject: Re: [gentoo-portage-dev] [PATCH v3] portage/glsa.py: only check for revision based on GLSA DTD
Date: Mon, 19 Aug 2019 01:12:40
Message-Id: e4c89f94-a8df-1c21-a307-a8c6b8a6c1d6@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH v3] portage/glsa.py: only check for revision based on GLSA DTD by Aaron Bauman
1 On 8/14/19 11:05 AM, Aaron Bauman wrote:
2 > * All GLSA's have been converted to use the revision attribute
3 > * If there is no count attribute then raise a GlsaFormatException
4 > * Ensure the attribute is an integer
5 >
6 > Signed-off-by: Aaron Bauman <bman@g.o>
7 > ---
8 > lib/portage/glsa.py | 15 +++++----------
9 > 1 file changed, 5 insertions(+), 10 deletions(-)
10 >
11 > diff --git a/lib/portage/glsa.py b/lib/portage/glsa.py
12 > index ccf93439d..3fd877b22 100644
13 > --- a/lib/portage/glsa.py
14 > +++ b/lib/portage/glsa.py
15 > @@ -528,25 +528,20 @@ class Glsa:
16 > self.synopsis = getText(myroot.getElementsByTagName("synopsis")[0], format="strip")
17 > self.announced = format_date(getText(myroot.getElementsByTagName("announced")[0], format="strip"))
18 >
19 > - # Support both formats of revised:
20 > - # <revised>December 30, 2007: 02</revised>
21 > + # Support only format defined in GLSA DTD
22 > # <revised count="2">2007-12-30</revised>
23 > revisedEl = myroot.getElementsByTagName("revised")[0]
24 > self.revised = getText(revisedEl, format="strip")
25 > count = revisedEl.getAttribute("count")
26 > if not count:
27 > - if self.revised.find(":") >= 0:
28 > - (self.revised, count) = self.revised.split(":")
29 > - else:
30 > - count = 1
31 > -
32 > - self.revised = format_date(self.revised)
33 > + raise GlsaFormatException("Count attribute is missing or blank in GLSA: " + myroot.getAttribute("id"))
34 >
35 > try:
36 > self.count = int(count)
37 > except ValueError:
38 > - # TODO should this raise a GlsaFormatException?
39 > - self.count = 1
40 > + raise GlsaFormatException("Revision attribute in GLSA: " + myroot.getAttribute("id") + " is not an integer")
41 > +
42 > + self.revised = format_date(self.revised)
43 >
44 > # now the optional and 0-n toplevel, #PCDATA tags and references
45 > try:
46 >
47
48 Thanks, merged:
49
50 https://gitweb.gentoo.org/proj/portage.git/commit/?id=98f8a4a8f5c38dfb3c797ad8d66f8cac1822805d
51 --
52 Thanks,
53 Zac

Attachments

File name MIME type
signature.asc application/pgp-signature