]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
Fix handling of disabled installed packages in distupgrade
authorMichael Schroeder <mls@suse.de>
Tue, 8 Oct 2019 11:40:45 +0000 (13:40 +0200)
committerMichael Schroeder <mls@suse.de>
Tue, 8 Oct 2019 11:40:45 +0000 (13:40 +0200)
Such packages must not be touched, i.e. they must stay installed.

src/pool.c
src/rules.c

index d2053b9c8cb6675c520eeb243ec29f8ba7573af0..76636a78c16e1f55f7915380f6ad554470928a68 100644 (file)
@@ -455,7 +455,6 @@ pool_createwhatprovides(Pool *pool)
   Offset *whatprovides;
   Id *whatprovidesdata, *dp, *whatprovidesauxdata;
   Offset *whatprovidesaux;
-  Repo *installed = pool->installed;
   unsigned int now;
 
   now = solv_timems(0);
index 4075b9d021089ed7c103158a828dfc60b8931e29..57895c01619284f840b29fa4cbc8ed72a8d06ba4 100644 (file)
@@ -1373,6 +1373,14 @@ solver_addupdaterule(Solver *solv, Solvable *s)
   int dupinvolved = 0;
 
   p = s - pool->solvables;
+
+  if (pool->considered && pool_disabled_solvable(pool, s))
+    {
+      /* disabled installed solvables must stay installed */
+      solver_addrule(solv, p, 0, 0);
+      return;
+    }
+
   /* Orphan detection. We cheat by looking at the feature rule, which
    * we already calculated */
   r = solv->rules + solv->featurerules + (p - solv->installed->start);
@@ -2003,6 +2011,8 @@ solver_addduprules(Solver *solv, Map *addedmap)
            continue;
          if (installed && ps->repo == installed)
            {
+             if (pool->considered && pool_disabled_solvable(pool, ps))
+               continue;               /* always keep disabled installed packages */
              if (!MAPTST(&solv->dupmap, p))
                {
                  Id ip, ipp;