Blame SOURCES/0014-Mark-job-goalupgrade-with-sltr-as-targeted.patch

Pablo Greco df9f9f
From a9e281087d075f798ac64dad657d34816d533d2a Mon Sep 17 00:00:00 2001
Pablo Greco df9f9f
From: Jaroslav Mracek <jmracek@redhat.com>
Pablo Greco df9f9f
Date: Tue, 3 Sep 2019 11:01:23 +0200
Pablo Greco df9f9f
Subject: [PATCH] Mark job goal.upgrade with sltr as targeted
Pablo Greco df9f9f
Pablo Greco df9f9f
It allows to keep installed packages in upgrade set.
Pablo Greco df9f9f
Pablo Greco df9f9f
It also prevents from reinstalling of modified packages with same NEVRA.
Pablo Greco df9f9f
---
Pablo Greco df9f9f
 libdnf/goal/Goal.cpp | 2 +-
Pablo Greco df9f9f
 libdnf/goal/Goal.hpp | 6 ++++--
Pablo Greco df9f9f
 2 files changed, 5 insertions(+), 3 deletions(-)
Pablo Greco df9f9f
Pablo Greco df9f9f
diff --git a/libdnf/goal/Goal.cpp b/libdnf/goal/Goal.cpp
Pablo Greco df9f9f
index b69be19..a38cbb4 100644
Pablo Greco df9f9f
--- a/libdnf/goal/Goal.cpp
Pablo Greco df9f9f
+++ b/libdnf/goal/Goal.cpp
Pablo Greco df9f9f
@@ -767,7 +767,7 @@ void
Pablo Greco df9f9f
 Goal::upgrade(HySelector sltr)
Pablo Greco df9f9f
 {
Pablo Greco df9f9f
     pImpl->actions = static_cast<DnfGoalActions>(pImpl->actions | DNF_UPGRADE);
Pablo Greco df9f9f
-    sltrToJob(sltr, &pImpl->staging, SOLVER_UPDATE);
Pablo Greco df9f9f
+    sltrToJob(sltr, &pImpl->staging, SOLVER_UPDATE|SOLVER_TARGETED);
Pablo Greco df9f9f
 }
Pablo Greco df9f9f
 
Pablo Greco df9f9f
 void
Pablo Greco df9f9f
diff --git a/libdnf/goal/Goal.hpp b/libdnf/goal/Goal.hpp
Pablo Greco df9f9f
index f33dfa2..d701317 100644
Pablo Greco df9f9f
--- a/libdnf/goal/Goal.hpp
Pablo Greco df9f9f
+++ b/libdnf/goal/Goal.hpp
Pablo Greco df9f9f
@@ -86,8 +86,10 @@ public:
Pablo Greco df9f9f
     /**
Pablo Greco df9f9f
     * @brief If selector ill formed, it rises std::runtime_error()
Pablo Greco df9f9f
     *
Pablo Greco df9f9f
-    * @param sltr p_sltr: It should contain only upgrades with obsoletes otherwise it can try to
Pablo Greco df9f9f
-    * reinstall installonly packages.
Pablo Greco df9f9f
+    * @param sltr p_sltr: It contains upgrade-to packages and obsoletes. The presence of installed
Pablo Greco df9f9f
+    * packages prevents reinstalling packages with the same NEVRA but changed contant. To honor repo
Pablo Greco df9f9f
+    * priority all relevant packages must be present. To upgrade package foo from priority repo, all
Pablo Greco df9f9f
+    * installed and available packages of the foo must be in selector plus obsoletes of foo.
Pablo Greco df9f9f
     */
Pablo Greco df9f9f
     void upgrade(HySelector sltr);
Pablo Greco df9f9f
     void userInstalled(DnfPackage *pkg);
Pablo Greco df9f9f
--
Pablo Greco df9f9f
libgit2 0.28.2
Pablo Greco df9f9f