Blame SOURCES/0003-Use-installed_all-because-installed_query-is-filtere.patch

a58eb0
From 776241568cb10e3a671c574b25e06b63d86e7ac0 Mon Sep 17 00:00:00 2001
a58eb0
From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= <amatej@redhat.com>
a58eb0
Date: Mon, 4 Jul 2022 09:46:29 +0200
a58eb0
Subject: [PATCH] Use `installed_all` because `installed_query` is filtered
a58eb0
 user input
a58eb0
a58eb0
`installed_query` could be missing packages. If we specify we want to
a58eb0
upgrade a specific nevra that is not yet installed, then `installed_query`
a58eb0
is empty because it is based on user input, but there could be other
a58eb0
versions of the pkg installed.
a58eb0
a58eb0
Eg: if kernel-1 and kernel-3 are installed and we specify we want to
a58eb0
upgrade kernel-2, nothing should be done because we already have higher
a58eb0
version, but now `installed_query` would be empty and kernel-2 would be
a58eb0
installed.
a58eb0
a58eb0
Therefore, we need to use `installed_all`.
a58eb0
---
a58eb0
 dnf/base.py | 2 +-
a58eb0
 1 file changed, 1 insertion(+), 1 deletion(-)
a58eb0
a58eb0
diff --git a/dnf/base.py b/dnf/base.py
a58eb0
index 92fb3bd0..1b0f07ed 100644
a58eb0
--- a/dnf/base.py
a58eb0
+++ b/dnf/base.py
a58eb0
@@ -2135,7 +2135,7 @@ class Base(object):
a58eb0
             #     packages. Otherwise if for example kernel-1 and kernel-3 were installed and present in the
a58eb0
             #     transaction libsolv could decide to install kernel-2 because it is an upgrade for kernel-1 even
a58eb0
             #     though we don't want it because there already is a newer version present.
a58eb0
-            query = query.union(installed_query.latest().filter(name=[pkg.name for pkg in query]))
a58eb0
+            query = query.union(installed_all.latest().filter(name=[pkg.name for pkg in query]))
a58eb0
             sltr = dnf.selector.Selector(self.sack)
a58eb0
             sltr.set(pkg=query)
a58eb0
             self._goal.upgrade(select=sltr)
a58eb0
-- 
a58eb0
2.36.1
a58eb0