commit:     1ffaa70544f34e93df24c0a175105a900bf272bf
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 11 04:50:24 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jul 11 23:01:04 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=1ffaa705

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 <sam <AT> gentoo.org>

 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 132e050f2..6b2996c31 100644
--- a/lib/portage/news.py
+++ b/lib/portage/news.py
@@ -281,10 +281,9 @@ class NewsItem:
         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

Reply via email to