Blame SOURCES/0001-Make-sure-that-targeted-updates-dont-do-reinstalls.patch

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