From 0a5679dd346612bb8a96b40c2b4007942dcab9ed Mon Sep 17 00:00:00 2001 From: Jaroslav Rohel Date: Mon, 1 Oct 2018 16:08:58 +0200 Subject: [PATCH] Bacport patch: Make sure that targeted updates don't do reinstalls --- ...-targeted-updates-dont-do-reinstalls.patch | 61 +++++++++++++++++++ libsolv.spec | 6 +- 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 0001-Make-sure-that-targeted-updates-dont-do-reinstalls.patch diff --git a/0001-Make-sure-that-targeted-updates-dont-do-reinstalls.patch b/0001-Make-sure-that-targeted-updates-dont-do-reinstalls.patch new file mode 100644 index 0000000..1cd418a --- /dev/null +++ b/0001-Make-sure-that-targeted-updates-dont-do-reinstalls.patch @@ -0,0 +1,61 @@ +From 0e29e1188c19609e117478a0df1cb995a2f9e745 Mon Sep 17 00:00:00 2001 +From: Michael Schroeder +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 + diff --git a/libsolv.spec b/libsolv.spec index ec172d3..6419d5b 100644 --- a/libsolv.spec +++ b/libsolv.spec @@ -42,7 +42,7 @@ Name: lib%{libname} Version: 0.6.35 -Release: 2%{?commit:.git.%{commitnum}.%{?shortcommit}}%{?dist} +Release: 3%{?commit:.git.%{commitnum}.%{?shortcommit}}%{?dist} Summary: Package dependency solver License: BSD @@ -52,6 +52,7 @@ Source: %{url}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz %else Source: %{url}/archive/%{version}/%{name}-%{version}.tar.gz %endif +Patch0: 0001-Make-sure-that-targeted-updates-dont-do-reinstalls.patch BuildRequires: cmake BuildRequires: gcc-c++ @@ -294,6 +295,9 @@ Python 3 version. %endif %changelog +* Mon Oct 01 2018 Jaroslav Rohel - 0.6.35-3 +- Backport patch: Make sure that targeted updates don't do reinstalls + * Mon Oct 01 2018 Igor Gnatenko - 0.6.35-2 - Disable python2 subpackage