Skip to content

Commit

Permalink
news: fix isRelevant check
Browse files Browse the repository at this point in the history
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: 9e24d01
Reported-by: kurly
Signed-off-by: Sam James <sam@gentoo.org>
  • Loading branch information
thesamesam committed Jul 11, 2022
1 parent b67c57c commit 1ffaa70
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/portage/news.py
Expand Up @@ -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
Expand Down

0 comments on commit 1ffaa70

Please sign in to comment.