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 CD01F138216 for ; Mon, 2 May 2016 21:30:34 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4EA6321C07B; Mon, 2 May 2016 21:30:31 +0000 (UTC) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (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 C268E21C04B for ; Mon, 2 May 2016 21:30:30 +0000 (UTC) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 2265020D02 for ; Mon, 2 May 2016 17:30:30 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute4.internal (MEProxy); Mon, 02 May 2016 17:30:30 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=L0sDf3kSVdOn3Q5 /Q/EVMoANFbA=; b=JvxqIqE1/9Wd9qZKxAr03YG+Yu86vd+Rrm3yDARtRHWc7bZ 5NwCF3ISEJYBfdLN2s03prVVQYP++s2NmTgbaq28syZ605CimcBGhFOCbnwZETMn a7Y81ZOHiXHIZ5oGc9uYlUC5/ebvd3k+Zm6tQxP9yeSCUKVeBOkKVt2NSkE8= X-Sasl-enc: 9Ym4fwt4Z9ln5Ctvvr9W1dLAGiRU4bvXOjuvLrxw70Cd 1462224629 Received: from 127.0.0.1 (unknown [91.109.29.120]) by mail.messagingengine.com (Postfix) with ESMTPA id 15A0368013B for ; Mon, 2 May 2016 17:30:28 -0400 (EDT) From: =?UTF-8?B?R8O2a3TDvHJrIFnDvGtzZWs=?= Subject: Re: [gentoo-portage-dev] [PATCH 2/2] xml-test/missing-attributes: missing mandatory attributes for various tags To: gentoo-portage-dev@lists.gentoo.org References: <1462151327-16226-1-git-send-email-gokturk@binghamton.edu> <1462151327-16226-2-git-send-email-gokturk@binghamton.edu> <20160501183850.437fd727.dolsen@gentoo.org> <20160502104618.024ad576.dolsen@gentoo.org> X-Enigmail-Draft-Status: N1110 Message-ID: <5727C6F2.60709@binghamton.edu> Date: Mon, 2 May 2016 17:30:26 -0400 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@lists.gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org MIME-Version: 1.0 In-Reply-To: <20160502104618.024ad576.dolsen@gentoo.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Archives-Salt: d4ce5d86-c4da-401b-970c-f67f3bb56589 X-Archives-Hash: b465ef4b9178f2335fc8c185ab0a641b Brian Dolbec: > On Sun, 1 May 2016 18:38:50 -0700 > Brian Dolbec wrote: > >> On Sun, 1 May 2016 21:08:47 -0400 >> Göktürk Yüksek wrote: >> >>> Check for: >>> - type attribute in >>> - name attribute in >>> - name attribute in >>> - type attribute for >>> >>> Signed-off-by: Göktürk Yüksek >>> --- >>> xml-test/missing-attributes/metadata.xml | 23 >>> ++++++++++++++++++++++ .../missing-attributes-0.1.ebuild >>> | 13 ++++++++++++ 2 files changed, 36 insertions(+) >>> create mode 100644 xml-test/missing-attributes/metadata.xml >>> create mode 100644 >>> xml-test/missing-attributes/missing-attributes-0.1.ebuild >>> >>> diff --git a/xml-test/missing-attributes/metadata.xml >>> b/xml-test/missing-attributes/metadata.xml new file mode 100644 >>> index 0000000..cf51afd >>> --- /dev/null >>> +++ b/xml-test/missing-attributes/metadata.xml >>> @@ -0,0 +1,23 @@ >>> + >>> +>> "http://www.gentoo.org/dtd/metadata.dtd"> + >>> + >>> + >>> + foodev@gentoo.org >>> + >>> + >>> + >>> + Bar slot >>> + >>> + >>> + >>> + Baz flag >>> + >>> + >>> + >>> + gentoo/gen-b0rk >>> + >>> + >>> + Tests for mandatory attributes for various tags >>> + >>> + >>> diff --git >>> a/xml-test/missing-attributes/missing-attributes-0.1.ebuild >>> b/xml-test/missing-attributes/missing-attributes-0.1.ebuild new file >>> mode 100644 index 0000000..5733009 --- /dev/null >>> +++ b/xml-test/missing-attributes/missing-attributes-0.1.ebuild >>> @@ -0,0 +1,13 @@ >>> +# Copyright 1999-2016 Gentoo Foundation >>> +# Distributed under the terms of the GNU General Public License v2 >>> +# $Id$ >>> + >>> +EAPI=6 >>> + >>> +DESCRIPTION="Missing various mandatory attributes in the metadata" >>> +HOMEPAGE="https://wiki.gentoo.org/wiki/GLEP:68" >>> +SRC_URI="" >>> + >>> +LICENSE="HPND" >>> +SLOT="0" >>> +KEYWORDS="~amd64" >> >> Thank you, push it please :) >> > > Am I getting this correct? There are 4 errors in this metadata.xml? > > If that is the case, I am getting only 1 error reported for both 2.2.28 > and the master branch code. > > master branch code: > > brian@professor-x ~/Dev/git/gen-b0rk/xml-test $ repom full > > RepoMan scours the neighborhood... > metadata.bad [fatal] 1 > xml-test/missing-attributes/metadata.xml: missing 'name' attribute > for 'flag' tag metadata.missing [fatal] 1 > xml-test/missing/metadata.xml > > Note: use --include-dev (-d) to check dependencies for 'dev' profiles > > Please fix these important QA issues first. > RepoMan sez: "Make your QA payment on time and you'll never see the > likes of me." > > > > Portage-2.2.28 release: > > brian@professor-x ~/Dev/git/gen-b0rk/xml-test $ repoman full > > RepoMan scours the neighborhood... > metadata.bad [fatal] 1 > xml-test/missing-attributes/metadata.xml: missing 'name' attribute > for 'flag' tag metadata.missing [fatal] 1 > xml-test/missing/metadata.xml > > Note: use --include-dev (-d) to check dependencies for 'dev' profiles > > Please fix these important QA issues first. > RepoMan sez: "Make your QA payment on time and you'll never see the > likes of me." > > brian@professor-x ~/Dev/git/gen-b0rk/xml-test $ > > xmllint seems to catch 3 out of 4 for DTD and all 4 for xsd: $ xmllint --nonet --noout --dtdvalid /usr/portage/distfiles/metadata.dtd metadata.xml metadata.xml:10: element slot: validity error : Element slot does not carry attribute name metadata.xml:14: element flag: validity error : Element flag does not carry attribute name metadata.xml:18: element remote-id: validity error : Element remote-id does not carry attribute type Document metadata.xml does not validate against /usr/portage/distfiles/metadata.dtd $ xmllint --nonet --noout --schema /usr/portage/distfiles/metadata.xsd metadata.xml metadata.xml:5: element maintainer: Schemas validity error : Element 'maintainer': The attribute 'type' is required but missing. metadata.xml:10: element slot: Schemas validity error : Element 'slot': The attribute 'name' is required but missing. metadata.xml:14: element flag: Schemas validity error : Element 'flag': The attribute 'name' is required but missing. metadata.xml:18: element remote-id: Schemas validity error : Element 'remote-id': The attribute 'type' is required but missing. metadata.xml fails to validate If I supply and run repom again, it prints all the errors: $ repom full RepoMan scours the neighborhood... !!! metadata.xml is invalid: !!! /home/gokturk/stuff/gen-b0rk/xml-test/missing-attributes/metadata.xml:5: element maintainer: Schemas validity error : Element 'maintainer': The attribute 'type' is required but missing. !!! /home/gokturk/stuff/gen-b0rk/xml-test/missing-attributes/metadata.xml:10: element slot: Schemas validity error : Element 'slot': The attribute 'name' is required but missing. !!! /home/gokturk/stuff/gen-b0rk/xml-test/missing-attributes/metadata.xml:18: element remote-id: Schemas validity error : Element 'remote-id': The attribute 'type' is required but missing. !!! /home/gokturk/stuff/gen-b0rk/xml-test/missing-attributes/metadata.xml fails to validate metadata.bad [fatal] 1 xml-test/missing-attributes/metadata.xml metadata.warning 1 xml-test/missing-attributes/metadata.xml: unused local USE-description: 'baz' Note: use --include-dev (-d) to check dependencies for 'dev' profiles Please fix these important QA issues first. RepoMan sez: "Make your QA payment on time and you'll never see the likes of me." I am looking at the code and looks like there's an early fail in pkgmetadata.py: 93 try: 94 _metadata_xml = xml.etree.ElementTree.parse( 95 _unicode_encode( 96 os.path.join(checkdir, "metadata.xml"), 97 encoding=_encodings['fs'], errors='strict'), 98 parser=xml_parser) 99 except (ExpatError, SyntaxError, EnvironmentError) as e: 100 metadata_bad = True 101 self.qatracker.add_error("metadata.bad", "%s/metadata.xml: %s" % (xpkg, e)) I do not know why there's a difference in behavior. If it early-fails for missing name in , it should behave the same for missing name in . I'll dig into it more when I have time.