jdieter / rpms / libdnf

Forked from rpms/libdnf 4 years ago
Clone

Blame 0005-Apply-targeted-upgrade-only-for-selector-with-packages.patch

63b2c4b
From c235dae84d1b45911f6de1c5d31fedf4856c0d42 Mon Sep 17 00:00:00 2001
63b2c4b
From: Jaroslav Mracek <jmracek@redhat.com>
63b2c4b
Date: Wed, 11 Sep 2019 13:26:43 +0200
63b2c4b
Subject: [PATCH] Apply targeted upgrade only for selector with packages
63b2c4b
63b2c4b
It resolves problem when selector with name filter is used. Then
63b2c4b
targeted transaction ignores obsoletes.
63b2c4b
63b2c4b
Closes: #793
63b2c4b
Approved by: jrohel
63b2c4b
---
63b2c4b
 libdnf/goal/Goal.cpp | 6 +++++-
63b2c4b
 1 file changed, 5 insertions(+), 1 deletion(-)
63b2c4b
63b2c4b
diff --git a/libdnf/goal/Goal.cpp b/libdnf/goal/Goal.cpp
63b2c4b
index a38cbb4..88e7b8c 100644
63b2c4b
--- a/libdnf/goal/Goal.cpp
63b2c4b
+++ b/libdnf/goal/Goal.cpp
63b2c4b
@@ -767,7 +767,11 @@ void
63b2c4b
 Goal::upgrade(HySelector sltr)
63b2c4b
 {
63b2c4b
     pImpl->actions = static_cast<DnfGoalActions>(pImpl->actions | DNF_UPGRADE);
63b2c4b
-    sltrToJob(sltr, &pImpl->staging, SOLVER_UPDATE|SOLVER_TARGETED);
63b2c4b
+    auto flags = SOLVER_UPDATE;
63b2c4b
+    if (sltr->getPkgs()) {
63b2c4b
+        flags |= SOLVER_TARGETED;
63b2c4b
+    }
63b2c4b
+    sltrToJob(sltr, &pImpl->staging, flags);
63b2c4b
 }
63b2c4b
 
63b2c4b
 void
63b2c4b
--
63b2c4b
libgit2 0.28.2
63b2c4b