Blame SOURCES/0027-Don-t-include-resolved-advisories-for-obsoletes-with.patch

eb8139
From 66a37245e82c60b972ee35879f9c29c27466a27b Mon Sep 17 00:00:00 2001
eb8139
From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= <amatej@redhat.com>
eb8139
Date: Mon, 25 Jul 2022 12:44:17 +0200
eb8139
Subject: [PATCH] Don't include resolved advisories for obsoletes with sec.
eb8139
 filters (RhBug:2101421)
eb8139
eb8139
This makes the obsoletes security filters consistent with upgrade
eb8139
security filters.
eb8139
eb8139
This API is used from check-update and from Info and List commands.
eb8139
- For check-update we don't want to include resolved advisories to have
eb8139
  identical result to the actual update. That is bz2101421 use case.
eb8139
- For Info and List commands the --obsoletes switch: "List packages
eb8139
  installed on the system that are obsoleted by packages in any known
eb8139
  repository." Given this specification in makes sense not to
eb8139
  consider resolved advisories when we also use security filters.
eb8139
eb8139
There is still a general case when someone uses the API or any potential
eb8139
future use and I think it is best to have the behavior unified for
eb8139
"upgrades" and "obsoletes".
eb8139
eb8139
= changelog =
eb8139
msg:           Don't include resolved advisories for obsoletes filtering with security filters
eb8139
type:          bugfix
eb8139
resolves:      https://bugzilla.redhat.com/show_bug.cgi?id=2101421
eb8139
eb8139
Tests: https://github.com/rpm-software-management/ci-dnf-stack/pull/1134
eb8139
---
eb8139
 dnf/base.py | 2 +-
eb8139
 1 file changed, 1 insertion(+), 1 deletion(-)
eb8139
eb8139
diff --git a/dnf/base.py b/dnf/base.py
eb8139
index e606d9fa..e623d98e 100644
eb8139
--- a/dnf/base.py
eb8139
+++ b/dnf/base.py
eb8139
@@ -1565,7 +1565,7 @@ class Base(object):
eb8139
             obsoletes = query_for_repo(
eb8139
                 self.sack.query()).filter(obsoletes_by_priority=inst)
eb8139
             # reduce a query to security upgrades if they are specified
eb8139
-            obsoletes = self._merge_update_filters(obsoletes, warning=False)
eb8139
+            obsoletes = self._merge_update_filters(obsoletes, warning=False, upgrade=True)
eb8139
             obsoletesTuples = []
eb8139
             for new in obsoletes:
eb8139
                 obsoleted_reldeps = new.obsoletes
eb8139
-- 
eb8139
2.37.1
eb8139