From 1ffaa70544f34e93df24c0a175105a900bf272bf Mon Sep 17 00:00:00 2001 From: Sam James Date: Mon, 11 Jul 2022 05:50:24 +0100 Subject: [PATCH] news: fix isRelevant check Manifested as all news items being shown, even if (very) irrelevant to the running system (e.g. different arch, packages not installed, ...). I think the distinction here is that with the previous state, we'd end up with _only_ Trues, or nothing (an element would be omitted), whereas this commit means we end up considering a possible mixed sequence. Closes: https://bugs.gentoo.org/857669 Fixes: 9e24d0143450628f334cdb62e579efafd1bfd2ba Reported-by: kurly Signed-off-by: Sam James --- lib/portage/news.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/portage/news.py b/lib/portage/news.py index 132e050f2f..6b2996c312 100644 --- a/lib/portage/news.py +++ b/lib/portage/news.py @@ -281,10 +281,9 @@ def isRelevant(self, vardb, config, profile): kwargs = {"vardb": vardb, "config": config, "profile": profile} all_match = all( - True + restriction.checkRestriction(**kwargs) for values in self.restrictions.values() for restriction in values - if restriction.checkRestriction(**kwargs) ) return all_match