richardphibel / rpms / libdnf

Forked from rpms/libdnf 2 years ago
Clone

Blame SOURCES/0015-Apply-targeted-upgrade-only-for-selector-with-packages.patch

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