Fix reinstalling of packages with a different buildtime

This commit is contained in:
Jaroslav Mracek 2019-09-10 09:31:40 +02:00
parent 858cf8b699
commit 3471028bfd
2 changed files with 66 additions and 2 deletions

View File

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

View File

@ -1,7 +1,7 @@
%global libsolv_version 0.7.4-1
%global libmodulemd_version 1.6.1
%global librepo_version 1.10.0
%global dnf_conflict 4.2.5
%global dnf_conflict 4.2.9-3
%global swig_version 3.0.12
%bcond_with valgrind
@ -38,7 +38,7 @@
Name: libdnf
Version: 0.35.3
Release: 2%{?dist}
Release: 3%{?dist}
Summary: Library providing simplified C and Python API to libsolv
License: LGPLv2+
URL: https://github.com/rpm-software-management/libdnf
@ -47,6 +47,7 @@ Patch0001: 0001-Revert-9309e92332241ff1113433057c969cebf127734e.patch
# Temporary patch to not fail on modular RPMs without modular metadata
# until the infrastructure is ready
Patch0002: 0002-Revert-consequences-of-Fail-Safe-mechanism.patch
Patch0003: 0004-Mark-job-goalupgrade-with-sltr-as-targeted.patch
BuildRequires: cmake
BuildRequires: gcc
@ -269,6 +270,9 @@ popd
%endif
%changelog
* Thu Sep 10 2019 Jaroslav Mracek <jmracek@redhat.com> - 0.35.3-3
- Backport patch to fix reinstalling packages with a different buildtime
* Thu Aug 15 2019 Miro Hrončok <mhroncok@redhat.com> - 0.35.3-2
- Rebuilt for Python 3.8