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 82E1B158020 for ; Tue, 27 Dec 2022 19:15:06 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 96A10E0809; Tue, 27 Dec 2022 19:15:05 +0000 (UTC) Received: from smtp.gentoo.org (smtp.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) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 7310AE07F9 for ; Tue, 27 Dec 2022 19:15:05 +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) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 80385340BB4 for ; Tue, 27 Dec 2022 19:15:04 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 96DCE7D0 for ; Tue, 27 Dec 2022 19:15:02 +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: <1672168133.5870fb301a195c17d481af90a3669e9ee8338085.arthurzam@gentoo> Subject: [gentoo-commits] proj/pkgcore/pkgcheck:master commit in: src/pkgcheck/checks/ X-VCS-Repository: proj/pkgcore/pkgcheck X-VCS-Files: src/pkgcheck/checks/metadata.py X-VCS-Directories: src/pkgcheck/checks/ X-VCS-Committer: arthurzam X-VCS-Committer-Name: Arthur Zamarin X-VCS-Revision: 5870fb301a195c17d481af90a3669e9ee8338085 X-VCS-Branch: master Date: Tue, 27 Dec 2022 19:15:02 +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: 85df9bbc-6552-42c3-aed7-b2dfa0fe349f X-Archives-Hash: df6bb6f7bb38c2026065b5ec7a7839c6 commit: 5870fb301a195c17d481af90a3669e9ee8338085 Author: Brian Harring gmail com> AuthorDate: Tue Dec 27 08:51:19 2022 +0000 Commit: Arthur Zamarin gentoo org> CommitDate: Tue Dec 27 19:08:53 2022 +0000 URL: https://gitweb.gentoo.org/proj/pkgcore/pkgcheck.git/commit/?id=5870fb30 Fix API compatibility w/ pkgcore revision eb6f4edd2 In that revision, USE flag validation is moved to eapi objects; EAPI ultimately arbitrates that, and it cleaned up some internal issues in atom. However, it broke pkgcheck's metadata check which was using that regex directly; that code's broken anyways- any demandloaded object must not be imported into another scope; the lazy replacement only affects the original scope, thus that `self.valid_use = ` was pinning the proxied regex. Either way; since EAPI objects now have a use flag validation method, use that. Resolves: https://github.com/pkgcore/pkgcheck/issues/502 Signed-off-by: Brian Harring gmail.com> Closes: https://github.com/pkgcore/pkgcheck/pull/503 Signed-off-by: Arthur Zamarin gentoo.org> src/pkgcheck/checks/metadata.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pkgcheck/checks/metadata.py b/src/pkgcheck/checks/metadata.py index 6e087c5f..56d54529 100644 --- a/src/pkgcheck/checks/metadata.py +++ b/src/pkgcheck/checks/metadata.py @@ -210,11 +210,10 @@ class IuseCheck(Check): def __init__(self, *args, use_addon): super().__init__(*args) self.iuse_handler = use_addon - self.valid_use = atom_mod.valid_use_flag.match self.bad_defaults = tuple(['-'] + [f'+{x}_' for x in self.use_expand_groups]) def feed(self, pkg): - if invalid := sorted(x for x in pkg.iuse_stripped if not self.valid_use(x)): + if invalid := sorted(x for x in pkg.iuse_stripped if not pkg.eapi.is_valid_use_flag(x)): yield InvalidUseFlags(invalid, pkg=pkg) if pkg.eapi.options.iuse_defaults and (bad_defaults := sorted(