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 9854713825A for ; Sun, 15 May 2016 23:51:23 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4963F1427A; Sun, 15 May 2016 23:51:17 +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 680D9141A5 for ; Sun, 15 May 2016 23:51:16 +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 1565D340B9A for ; Sun, 15 May 2016 23:51:15 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 8634C335 for ; Sun, 15 May 2016 23:51:12 +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: <1463250580.9c3e213142e0e39f69dc002bd15402a7a2ff22d1.dolsen@gentoo> Subject: [gentoo-commits] proj/portage:master 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: 9c3e213142e0e39f69dc002bd15402a7a2ff22d1 X-VCS-Branch: master Date: Sun, 15 May 2016 23:51:12 +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: 2e6d6bff-969b-47f6-b16a-c0b8f282d939 X-Archives-Hash: 42acbfb8cd57f8be2a06fd47a128d7b1 Message-ID: <20160515235112.Yixi2PP-w3WYt1PvaSutOV-x1v0IQ4SLmvWBNW60Bg0@z> commit: 9c3e213142e0e39f69dc002bd15402a7a2ff22d1 Author: Dirkjan Ochtman ochtman nl> AuthorDate: Mon Jan 25 19:45:31 2016 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Sat May 14 18:29:40 2016 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=9c3e2131 repoman: mandate use of python 2.7 or 3.2+ for simplicity pym/repoman/modules/scan/metadata/pkgmetadata.py | 78 +++++++++++------------- 1 file changed, 36 insertions(+), 42 deletions(-) diff --git a/pym/repoman/modules/scan/metadata/pkgmetadata.py b/pym/repoman/modules/scan/metadata/pkgmetadata.py index af53f4b..bcddb3e 100644 --- a/pym/repoman/modules/scan/metadata/pkgmetadata.py +++ b/pym/repoman/modules/scan/metadata/pkgmetadata.py @@ -162,54 +162,48 @@ class PkgMetadata(ScanBase, USEFlagChecks): self.muselist = frozenset(self.musedict) return False - if not hasattr(xml_parser, 'parser') or \ - sys.hexversion < 0x2070000 or \ - (sys.hexversion > 0x3000000 and sys.hexversion < 0x3020000): - # doctype is not parsed with python 2.6 or 3.1 - pass + if "XML_DECLARATION" not in xml_info: + self.qatracker.add_error( + "metadata.bad", "%s/metadata.xml: " + "xml declaration is missing on first line, " + "should be '%s'" % (xpkg, metadata_xml_declaration)) else: - if "XML_DECLARATION" not in xml_info: + xml_version, xml_encoding, xml_standalone = \ + xml_info["XML_DECLARATION"] + if xml_encoding is None or \ + xml_encoding.upper() != metadata_xml_encoding: + if xml_encoding is None: + encoding_problem = "but it is undefined" + else: + encoding_problem = "not '%s'" % xml_encoding self.qatracker.add_error( "metadata.bad", "%s/metadata.xml: " - "xml declaration is missing on first line, " - "should be '%s'" % (xpkg, metadata_xml_declaration)) - else: - xml_version, xml_encoding, xml_standalone = \ - xml_info["XML_DECLARATION"] - if xml_encoding is None or \ - xml_encoding.upper() != metadata_xml_encoding: - if xml_encoding is None: - encoding_problem = "but it is undefined" - else: - encoding_problem = "not '%s'" % xml_encoding - self.qatracker.add_error( - "metadata.bad", "%s/metadata.xml: " - "xml declaration encoding should be '%s', %s" % - (xpkg, metadata_xml_encoding, encoding_problem)) + "xml declaration encoding should be '%s', %s" % + (xpkg, metadata_xml_encoding, encoding_problem)) - if "DOCTYPE" not in xml_info: - metadata_bad = True + if "DOCTYPE" not in xml_info: + metadata_bad = True + self.qatracker.add_error( + "metadata.bad", + "%s/metadata.xml: %s" % (xpkg, "DOCTYPE is missing")) + else: + doctype_name, doctype_system, doctype_pubid = \ + xml_info["DOCTYPE"] + if doctype_system != metadata_dtd_uri: + if doctype_system is None: + system_problem = "but it is undefined" + else: + system_problem = "not '%s'" % doctype_system self.qatracker.add_error( - "metadata.bad", - "%s/metadata.xml: %s" % (xpkg, "DOCTYPE is missing")) - else: - doctype_name, doctype_system, doctype_pubid = \ - xml_info["DOCTYPE"] - if doctype_system != metadata_dtd_uri: - if doctype_system is None: - system_problem = "but it is undefined" - else: - system_problem = "not '%s'" % doctype_system - self.qatracker.add_error( - "metadata.bad", "%s/metadata.xml: " - "DOCTYPE: SYSTEM should refer to '%s', %s" % - (xpkg, metadata_dtd_uri, system_problem)) + "metadata.bad", "%s/metadata.xml: " + "DOCTYPE: SYSTEM should refer to '%s', %s" % + (xpkg, metadata_dtd_uri, system_problem)) - if doctype_name != metadata_doctype_name: - self.qatracker.add_error( - "metadata.bad", "%s/metadata.xml: " - "DOCTYPE: name should be '%s', not '%s'" % - (xpkg, metadata_doctype_name, doctype_name)) + if doctype_name != metadata_doctype_name: + self.qatracker.add_error( + "metadata.bad", "%s/metadata.xml: " + "DOCTYPE: name should be '%s', not '%s'" % + (xpkg, metadata_doctype_name, doctype_name)) # load USE flags from metadata.xml try: