Add patch from Robert Buchholz: Allow GLSA 2 DTD in doctype declaration
authorfuzzyray <fuzzyray@gentoo.org>
Thu, 7 May 2009 21:59:25 +0000 (21:59 -0000)
committerfuzzyray <fuzzyray@gentoo.org>
Thu, 7 May 2009 21:59:25 +0000 (21:59 -0000)
svn path=/trunk/gentoolkit/; revision=627

pym/gentoolkit/glsa/__init__.py

index 1389028a6ea7c39050d7d340882b221bde53a55d..b7985d9172255facb025c5882dd905126d336eb1 100644 (file)
@@ -470,7 +470,11 @@ class Glsa:
                self.DOM = xml.dom.minidom.parse(myfile)
                if not self.DOM.doctype:
                        raise GlsaTypeException(None)
-               elif self.DOM.doctype.systemId != "http://www.gentoo.org/dtd/glsa.dtd":
+               elif self.DOM.doctype.systemId == "http://www.gentoo.org/dtd/glsa.dtd":
+                       self.dtdversion = 0
+               elif self.DOM.doctype.systemId == "http://www.gentoo.org/dtd/glsa-2.dtd":
+                       self.dtdversion = 2
+               else:
                        raise GlsaTypeException(self.DOM.doctype.systemId)
                myroot = self.DOM.getElementsByTagName("glsa")[0]
                if self.type == "id" and myroot.getAttribute("id") != self.nr: