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