From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 5C16213824B for ; Sun, 8 May 2016 21:21:30 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 92DB421C0C9; Sun, 8 May 2016 21:21:20 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 8EE6F21C0E4 for ; Sun, 8 May 2016 21:21:19 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id AEB2D340BCD for ; Sun, 8 May 2016 21:21:18 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 07B46964 for ; Sun, 8 May 2016 21:21:15 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1462742322.4d2cb398e48cdd90499dee48d52072e147c64e0f.dolsen@gentoo> Subject: [gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/scan/metadata/ X-VCS-Repository: proj/portage X-VCS-Files: pym/repoman/modules/scan/metadata/pkgmetadata.py X-VCS-Directories: pym/repoman/modules/scan/metadata/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 4d2cb398e48cdd90499dee48d52072e147c64e0f X-VCS-Branch: repoman Date: Sun, 8 May 2016 21:21:15 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: ffd2835c-ebe0-4999-b701-5b3feadf8e84 X-Archives-Hash: 2dbb7a74c6ed172f78153825c3fe2f12 commit: 4d2cb398e48cdd90499dee48d52072e147c64e0f Author: Brian Dolbec gentoo org> AuthorDate: Tue May 3 17:38:19 2016 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Sun May 8 21:18:42 2016 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=4d2cb398 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