diff options
author | Michael Schroeder <mls@suse.de> | 2014-04-07 13:45:24 +0200 |
---|---|---|
committer | Michael Schroeder <mls@suse.de> | 2014-04-07 13:45:24 +0200 |
commit | 32c09a84548b3b9090884855721da9cc6d955fdc (patch) | |
tree | a08f237e0ac176a38079e583268bbc478d18821a /src | |
parent | 3ffe5b4b1be22466b715eab199992513a40e28f4 (diff) | |
download | libsolv-32c09a84548b3b9090884855721da9cc6d955fdc.tar.gz libsolv-32c09a84548b3b9090884855721da9cc6d955fdc.tar.bz2 libsolv-32c09a84548b3b9090884855721da9cc6d955fdc.zip |
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...
Diffstat (limited to 'src')
-rw-r--r-- | src/policy.c | 14 |
1 files changed, 11 insertions, 3 deletions
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); } } |