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 4566E138222 for ; Tue, 3 May 2016 17:43:46 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 073AF21C023; Tue, 3 May 2016 17:43:44 +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 A635C21C023 for ; Tue, 3 May 2016 17:43:43 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (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 A48FF3408A6 for ; Tue, 3 May 2016 17:43:42 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 9689C331 for ; Tue, 3 May 2016 17:43:39 +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: <1462297099.621a6852099848474ed2c0880eae52ebd85f1703.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: 621a6852099848474ed2c0880eae52ebd85f1703 X-VCS-Branch: repoman Date: Tue, 3 May 2016 17:43:39 +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: 6f48f44c-bd5b-498b-b5e1-e7b702066775 X-Archives-Hash: e3a9d7d2125f982ffbe23fc26993838e commit: 621a6852099848474ed2c0880eae52ebd85f1703 Author: Brian Dolbec gentoo org> AuthorDate: Tue May 3 17:38:19 2016 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Tue May 3 17:38:19 2016 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=621a6852 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 b231370..7390b5b 100644 --- a/pym/repoman/modules/scan/metadata/pkgmetadata.py +++ b/pym/repoman/modules/scan/metadata/pkgmetadata.py @@ -202,8 +202,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