commit:     eb6a62d9547f3de6677cbf64e6bd674ff8c5ba82
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Fri May 12 17:17:44 2023 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Fri May 12 17:17:44 2023 +0000
URL:        
https://gitweb.gentoo.org/proj/pkgcore/pkgcheck.git/commit/?id=eb6a62d9

ProfilesCheck: fix handling of profiles with neg_action package

When a "packages" file under a profile declares "-*" (meaning to remove
all defaults), pkgcore pushes a special token (`True`) into the packages
set. This is taken by ProfileStack to clean up previous stack, but the
check wasn't expecting this token. Fixes by adding skip for that token.

Resolves: https://github.com/pkgcore/pkgcheck/issues/577
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 src/pkgcheck/checks/profiles.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pkgcheck/checks/profiles.py b/src/pkgcheck/checks/profiles.py
index 5394dca7..3420e471 100644
--- a/src/pkgcheck/checks/profiles.py
+++ b/src/pkgcheck/checks/profiles.py
@@ -278,7 +278,7 @@ class ProfilesCheck(Check):
     )
     def _pkg_atoms(self, filename, node, vals):
         for x in iflatten_instance(vals, atom_cls):
-            if not self.search_repo.match(x):
+            if not isinstance(x, bool) and not self.search_repo.match(x):
                 yield UnknownProfilePackage(pjoin(node.name, filename), x)
 
     @verify_files(

Reply via email to