From: Michael Schroeder Date: Mon, 7 Apr 2014 11:45:24 +0000 (+0200) Subject: use "implicitobsoleteusescolors" to limit our update/feature rules X-Git-Tag: upstream/0.6.4~33 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=32c09a84548b3b9090884855721da9cc6d955fdc;p=platform%2Fupstream%2Flibsolv.git use "implicitobsoleteusescolors" to limit our update/feature rules We will only consider packages of the same color as update candidate. This currently also is true for the feature rules, thus the solver will not offer to use replacement packages of a different color. Let's see how this works out in real life... --- diff --git a/src/policy.c b/src/policy.c index 98991c5..cf05de0 100644 --- a/src/policy.c +++ b/src/policy.c @@ -1058,7 +1058,8 @@ policy_findupdatepackages(Solver *solv, Solvable *s, Queue *qs, int allow_all) ps = pool->solvables + p; if (s->name == ps->name) /* name match */ { - /* XXX: check implicitobsoleteusescolors? */ + if (pool->implicitobsoleteusescolors && !pool_colormatch(pool, s, ps)) + continue; if (!allowdowngrade && pool_evrcmp(pool, s->evr, ps->evr, EVRCMP_COMPARE) > 0) continue; } @@ -1066,6 +1067,11 @@ policy_findupdatepackages(Solver *solv, Solvable *s, Queue *qs, int allow_all) continue; else if (!solv->noupdateprovide && ps->obsoletes) /* provides/obsoletes combination ? */ { + /* check if package ps obsoletes installed package s */ + /* implicitobsoleteusescolors is somewhat wrong here, but we nevertheless + * use it to limit our update candidates */ + if ((pool->obsoleteusescolors || pool->implicitobsoleteusescolors) && !pool_colormatch(pool, s, ps)) + continue; obsp = ps->repo->idarraydata + ps->obsoletes; while ((obs = *obsp++) != 0) /* for all obsoletes */ { @@ -1074,8 +1080,6 @@ policy_findupdatepackages(Solver *solv, Solvable *s, Queue *qs, int allow_all) Solvable *ps2 = pool->solvables + p2; if (!pool->obsoleteusesprovides && !pool_match_nevr(pool, ps2, obs)) continue; - if (pool->obsoleteusescolors && !pool_colormatch(pool, s, ps2)) - continue; if (p2 == n) /* match ! */ break; } @@ -1113,6 +1117,10 @@ policy_findupdatepackages(Solver *solv, Solvable *s, Queue *qs, int allow_all) continue; if (!allowvendorchange && s->vendor != ps->vendor && policy_illegal_vendorchange(solv, s, ps)) continue; + /* implicitobsoleteusescolors is somewhat wrong here, but we nevertheless + * use it to limit our update candidates */ + if (pool->implicitobsoleteusescolors && !pool_colormatch(pool, s, ps)) + continue; queue_push(qs, p); } }