From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id C5266158020 for ; Mon, 26 Dec 2022 17:28:08 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1DC49E095C; Mon, 26 Dec 2022 17:28:08 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 09885E095C for ; Mon, 26 Dec 2022 17:28:08 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 20A2A3410CF for ; Mon, 26 Dec 2022 17:28:07 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 52B5D7F5 for ; Mon, 26 Dec 2022 17:28:04 +0000 (UTC) From: "Arthur Zamarin" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Arthur Zamarin" Message-ID: <1672075644.4bd982b59ab334c2c8da7f700034dc9ca71c048a.arthurzam@gentoo> Subject: [gentoo-commits] proj/pkgcore/pkgcore:master commit in: src/pkgcore/ebuild/ X-VCS-Repository: proj/pkgcore/pkgcore X-VCS-Files: src/pkgcore/ebuild/atom.py X-VCS-Directories: src/pkgcore/ebuild/ X-VCS-Committer: arthurzam X-VCS-Committer-Name: Arthur Zamarin X-VCS-Revision: 4bd982b59ab334c2c8da7f700034dc9ca71c048a X-VCS-Branch: master Date: Mon, 26 Dec 2022 17:28:04 +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-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 880469f1-a61b-4448-910b-9824acf33dca X-Archives-Hash: 37ce231300fde9041266a34db9a71a22 commit: 4bd982b59ab334c2c8da7f700034dc9ca71c048a Author: Brian Harring gmail com> AuthorDate: Mon Dec 26 00:32:13 2022 +0000 Commit: Arthur Zamarin gentoo org> CommitDate: Mon Dec 26 17:27:24 2022 +0000 URL: https://gitweb.gentoo.org/proj/pkgcore/pkgcore.git/commit/?id=4bd982b5 Convert to eapi_obj usage for subslot/iuse defaults in atom parsing. We already paid the cost of looking up the eapi obj constants, thus use it, and remove the atom implementations awareness of magic eapi constants. Signed-off-by: Brian Harring gmail.com> Signed-off-by: Arthur Zamarin gentoo.org> src/pkgcore/ebuild/atom.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/pkgcore/ebuild/atom.py b/src/pkgcore/ebuild/atom.py index c24a6d9ef..0bcd76b6c 100644 --- a/src/pkgcore/ebuild/atom.py +++ b/src/pkgcore/ebuild/atom.py @@ -132,7 +132,13 @@ class atom(boolean.AndRestriction, metaclass=klass.generic_equality): elif x[0] == "-": x = x[1:] - if x[-1] == ")" and eapi not in ("0", "1", "2", "3"): + if x[-1] == ")": + if not eapi_obj.options.has_use_dep_defaults: + raise errors.MalformedAtom( + orig_atom, + f"use dep defaults are not allowed in EAPI {eapi_obj}", + ) + # use defaults. if x[-3:] in ("(+)", "(-)"): x = x[:-3] @@ -182,7 +188,7 @@ class atom(boolean.AndRestriction, metaclass=klass.generic_equality): slot = None else: slots = (slot,) - if eapi not in ("0", "1", "2", "3", "4"): + if eapi_obj.options.sub_slotting: if slot[0:1] in ("*", "="): if len(slot) > 1: raise errors.MalformedAtom(