]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
Fix split provides not working if the update includes a forbidden vendor change
authorMichael Schroeder <mls@suse.de>
Tue, 8 Feb 2022 11:41:58 +0000 (12:41 +0100)
committerMichael Schroeder <mls@suse.de>
Fri, 4 Mar 2022 10:48:06 +0000 (11:48 +0100)
Check the feature rule instead of the update rule and make sure that the
old package really is updated.

src/solver_util.c

index bd5d4b4d1796a34db0fb045f93484be808ce51d5..96ba24eb5b3c13dd14279b393acfa74d3fb8bc43 100644 (file)
@@ -22,6 +22,7 @@
 #include "pool.h"
 #include "poolarch.h"
 #include "util.h"
+#include "evr.h"
 
 
 /*-------------------------------------------------------------------
@@ -36,10 +37,18 @@ solver_is_updating(Solver *solv, Id p)
   Id l, pp;
   if (solv->decisionmap[p] >= 0)
     return 0;  /* old package stayed */
-  r = solv->rules + solv->updaterules + (p - solv->installed->start);
+  r = solv->rules + solv->featurerules + (p - solv->installed->start);
+  if (!r->p)
+    r = solv->rules + solv->updaterules + (p - solv->installed->start);
   FOR_RULELITERALS(l, pp, r)
     if (l > 0 && l != p && solv->decisionmap[l] > 0)
-      return 1;
+      {
+       /* check that this is really an upgrade */
+       Solvable *si = pool->solvables + p;
+       Solvable *s = pool->solvables + l;
+       if (s->name != si->name || pool_evrcmp(pool, s->evr, si->evr, EVRCMP_COMPARE) > 0)
+          return 1;
+      }
   return 0;
 }