commit: 5870fb301a195c17d481af90a3669e9ee8338085 Author: Brian Harring <ferringb <AT> gmail <DOT> com> AuthorDate: Tue Dec 27 08:51:19 2022 +0000 Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> 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 <ferringb <AT> gmail.com> Closes: https://github.com/pkgcore/pkgcheck/pull/503 Signed-off-by: Arthur Zamarin <arthurzam <AT> 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(