From: Michael Schroeder Date: Mon, 12 Oct 2015 12:03:25 +0000 (+0200) Subject: Prefer to autouninstall orphans X-Git-Tag: 0.6.15~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36a4434559e3885f75f3e1e878f11f3b18fce920;p=thirdparty%2Flibsolv.git Prefer to autouninstall orphans --- diff --git a/src/solver.c b/src/solver.c index f371546a..87b6c45f 100644 --- a/src/solver.c +++ b/src/solver.c @@ -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)