diff options
author | Michael Schroeder <mls@suse.de> | 2008-05-06 16:22:12 +0000 |
---|---|---|
committer | Michael Schroeder <mls@suse.de> | 2008-05-06 16:22:12 +0000 |
commit | a7dd7d799bcd9ea87dc11dc6d0a53035efb92df2 (patch) | |
tree | 700f7a11e2f89b38d957cb14730d8439e6a04d19 /src/policy.c | |
parent | 88ac57a98599abef97a746da942dacd064266117 (diff) | |
download | libsolv-a7dd7d799bcd9ea87dc11dc6d0a53035efb92df2.tar.gz libsolv-a7dd7d799bcd9ea87dc11dc6d0a53035efb92df2.tar.bz2 libsolv-a7dd7d799bcd9ea87dc11dc6d0a53035efb92df2.zip |
- add pool_match_nevr() to match a single solvable's nevr against
a dependency (that's also how rpm4 handles obsoletes).
- use it for obsoetes and _NAME jobs
Diffstat (limited to 'src/policy.c')
-rw-r--r-- | src/policy.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/src/policy.c b/src/policy.c index 3e39745..48b2f26 100644 --- a/src/policy.c +++ b/src/policy.c @@ -22,16 +22,6 @@ #include "poolarch.h" -static inline Id dep2name(Pool *pool, Id dep) -{ - while (ISRELDEP(dep)) - { - Reldep *rd = rd = GETRELDEP(pool, dep); - dep = rd->name; - } - return dep; -} - static Solver *prune_best_version_arch_sortcmp_data; /*-----------------------------------------------------------------*/ @@ -258,12 +248,11 @@ prune_to_best_version(Solver *solv, Queue *plist) obsp = s->repo->idarraydata + s->obsoletes; while ((obs = *obsp++) != 0) { - Id obsname = dep2name(pool, obs); FOR_PROVIDES(p, pp, obs) { if (pool->solvables[p].name == s->name) continue; - if (!solv->obsoleteusesprovides && obsname != pool->solvables[p].name) + if (!solv->obsoleteusesprovides && !pool_match_nevr(pool, pool->solvables + p, obs)) continue; for (j = 0; j < plist->count; j++) { @@ -448,10 +437,9 @@ policy_findupdatepackages(Solver *solv, Solvable *s, Queue *qs, int allowall) obsp = ps->repo->idarraydata + ps->obsoletes; while ((obs = *obsp++) != 0) /* for all obsoletes */ { - Id obsname = dep2name(pool, obs); FOR_PROVIDES(p2, pp2, obs) /* and all matching providers of the obsoletes */ { - if (!solv->obsoleteusesprovides && obsname != pool->solvables[p2].name) + if (!solv->obsoleteusesprovides && !pool_match_nevr(pool, pool->solvables + p2, obs)) continue; if (p2 == n) /* match ! */ break; |