Bacport patch: Make sure that targeted updates don't do reinstalls

This commit is contained in:
Jaroslav Rohel 2018-10-01 16:08:58 +02:00
parent fa07070eb0
commit 0a5679dd34
2 changed files with 66 additions and 1 deletions

View File

@ -0,0 +1,61 @@
From 0e29e1188c19609e117478a0df1cb995a2f9e745 Mon Sep 17 00:00:00 2001
From: Michael Schroeder <mls@suse.de>
Date: Fri, 28 Sep 2018 14:48:14 +0200
Subject: [PATCH] Make sure that targeted updates don't do reinstalls
---
src/solver.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/src/solver.c b/src/solver.c
index 6405f4a..a4e0c4b 100644
--- a/src/solver.c
+++ b/src/solver.c
@@ -2957,7 +2957,9 @@ add_update_target(Solver *solv, Id p, Id how)
Pool *pool = solv->pool;
Solvable *s = pool->solvables + p;
Repo *installed = solv->installed;
- Id pi, pip;
+ Id pi, pip, identicalp;
+ int startcnt, endcnt;
+
if (!solv->update_targets)
{
solv->update_targets = solv_calloc(1, sizeof(Queue));
@@ -2968,6 +2970,8 @@ add_update_target(Solver *solv, Id p, Id how)
queue_push2(solv->update_targets, p, p);
return;
}
+ identicalp = 0;
+ startcnt = solv->update_targets->count;
FOR_PROVIDES(pi, pip, s->name)
{
Solvable *si = pool->solvables + pi;
@@ -2982,9 +2986,9 @@ add_update_target(Solver *solv, Id p, Id how)
if (how & SOLVER_CLEANDEPS)
add_cleandeps_updatepkg(solv, pi);
queue_push2(solv->update_targets, pi, p);
- /* check if it's ok to keep the installed package */
+ /* remember an installed package that is identical to p */
if (s->evr == si->evr && solvable_identical(s, si))
- queue_push2(solv->update_targets, pi, pi);
+ identicalp = pi;
}
if (s->obsoletes)
{
@@ -3014,6 +3018,12 @@ add_update_target(Solver *solv, Id p, Id how)
}
}
}
+ /* also allow upgrading to an identical installed package */
+ if (identicalp)
+ {
+ for (endcnt = solv->update_targets->count; startcnt < endcnt; startcnt += 2)
+ queue_push2(solv->update_targets, solv->update_targets->elements[startcnt], identicalp);
+ }
}
static int
--
libgit2 0.26.6

View File

@ -42,7 +42,7 @@
Name: lib%{libname} Name: lib%{libname}
Version: 0.6.35 Version: 0.6.35
Release: 2%{?commit:.git.%{commitnum}.%{?shortcommit}}%{?dist} Release: 3%{?commit:.git.%{commitnum}.%{?shortcommit}}%{?dist}
Summary: Package dependency solver Summary: Package dependency solver
License: BSD License: BSD
@ -52,6 +52,7 @@ Source: %{url}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz
%else %else
Source: %{url}/archive/%{version}/%{name}-%{version}.tar.gz Source: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
%endif %endif
Patch0: 0001-Make-sure-that-targeted-updates-dont-do-reinstalls.patch
BuildRequires: cmake BuildRequires: cmake
BuildRequires: gcc-c++ BuildRequires: gcc-c++
@ -294,6 +295,9 @@ Python 3 version.
%endif %endif
%changelog %changelog
* Mon Oct 01 2018 Jaroslav Rohel <jrohel@redhat.org> - 0.6.35-3
- Backport patch: Make sure that targeted updates don't do reinstalls
* Mon Oct 01 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.6.35-2 * Mon Oct 01 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.6.35-2
- Disable python2 subpackage - Disable python2 subpackage