Additional patch to fix reinstalling pkgs with a different buildtime

This commit is contained in:
Jaroslav Mracek 2019-09-11 17:21:58 +02:00
parent 3471028bfd
commit 63b2c4b2a6
2 changed files with 39 additions and 1 deletions

View File

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

View File

@ -38,7 +38,7 @@
Name: libdnf
Version: 0.35.3
Release: 3%{?dist}
Release: 4%{?dist}
Summary: Library providing simplified C and Python API to libsolv
License: LGPLv2+
URL: https://github.com/rpm-software-management/libdnf
@ -48,6 +48,7 @@ Patch0001: 0001-Revert-9309e92332241ff1113433057c969cebf127734e.patch
# until the infrastructure is ready
Patch0002: 0002-Revert-consequences-of-Fail-Safe-mechanism.patch
Patch0003: 0004-Mark-job-goalupgrade-with-sltr-as-targeted.patch
Patch0004: 0005-Apply-targeted-upgrade-only-for-selector-with-packages.patch
BuildRequires: cmake
BuildRequires: gcc
@ -270,6 +271,9 @@ popd
%endif
%changelog
* Wed Sep 11 2019 Jaroslav Mracek <jmracek@redhat.com> - 0.35.3-4
- Backport patch to fix reinstalling packages with a different buildtime - part II
* Thu Sep 10 2019 Jaroslav Mracek <jmracek@redhat.com> - 0.35.3-3
- Backport patch to fix reinstalling packages with a different buildtime