commit: 64bb8e17a5c050671765626bbe45174e10b5a3a4 Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org> AuthorDate: Tue May 3 17:38:19 2016 +0000 Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org> CommitDate: Sat May 14 18:29:40 2016 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=64bb8e17
repoman/modules/.../pkgmetadata.py: Improve whole document validation Change to using assertValid() and add the error causing validation to fail to the qa tracker error. pym/repoman/modules/scan/metadata/pkgmetadata.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pym/repoman/modules/scan/metadata/pkgmetadata.py b/pym/repoman/modules/scan/metadata/pkgmetadata.py index 4921b6f..1594b27 100644 --- a/pym/repoman/modules/scan/metadata/pkgmetadata.py +++ b/pym/repoman/modules/scan/metadata/pkgmetadata.py @@ -206,8 +206,14 @@ class PkgMetadata(ScanBase, USEFlagChecks): # Only carry out if in package directory or check forced if not metadata_bad: validator = etree.XMLSchema(file=self.metadata_xsd) - if not validator.validate(_metadata_xml): - self.qatracker.add_error("metadata.bad", xpkg + "/metadata.xml") + try: + validator.assertValid(_metadata_xml) + except etree.DocumentInvalid as error: + self.qatracker.add_error( + "metadata.bad", + xpkg + "/metadata.xml: %s" + % (str(error)) + ) del metadata_bad self.muselist = frozenset(self.musedict) return False