]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
Prefer to autouninstall orphans
authorMichael Schroeder <mls@suse.de>
Mon, 12 Oct 2015 12:03:25 +0000 (14:03 +0200)
committerMichael Schroeder <mls@suse.de>
Mon, 12 Oct 2015 12:03:25 +0000 (14:03 +0200)
src/solver.c

index f371546abcff6921143d7f5f0c5dcfbf32b6482b..87b6c45f77107e5fba25d94a1cc329fc91d882a1 100644 (file)
@@ -217,13 +217,24 @@ autouninstall(Solver *solv, Id *problem)
          Rule *r;
          if (m && !MAPTST(m, v - solv->updaterules))
            continue;
-         /* check if identical to feature rule, we don't like that */
+         /* check if identical to feature rule, we don't like that (except for orphans) */
          r = solv->rules + solv->featurerules + (v - solv->updaterules);
          if (!r->p)
            {
              /* update rule == feature rule */
              if (v > lastfeature)
                lastfeature = v;
+             /* prefer orphaned packages in dup mode */
+             if (solv->dupmap_all && solv->keep_orphans)
+               {
+                 r = solv->rules + v;
+                 if (!r->d && r->p == (solv->installed->start + (v - solv->updaterules)))
+                   {
+                     lastfeature = v;
+                     lastupdate = 0;
+                     break;
+                   }
+               }
              continue;
            }
          if (v > lastupdate)