Fix parse_metadata_use() to allow use elements containing no flag
authorZac Medico <zmedico@gentoo.org>
Mon, 6 Sep 2010 21:43:30 +0000 (14:43 -0700)
committerZac Medico <zmedico@gentoo.org>
Mon, 6 Sep 2010 21:43:30 +0000 (14:43 -0700)
elements since the DTD allows it. Thanks to Mark Loeser <Halcy0n@g.o>
for reporting.

pym/repoman/utilities.py

index e957c84b26b73118f3ddeb69de91abe0c0dc4694..5d32e0ce9d76ab36d3bfb4951f9005448af7cb88 100644 (file)
@@ -128,7 +128,8 @@ def parse_metadata_use(xml_tree):
        for usetag in usetags:
                flags = usetag.findall("flag")
                if not flags:
-                       raise exception.ParseError("missing 'flag' tag(s)")
+                       # DTD allows use elements containing no flag elements.
+                       continue
 
                for flag in flags:
                        pkg_flag = flag.get("name")