#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;
/*-----------------------------------------------------------------*/
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++)
{
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;
*
*/
-static inline Id dep2name(Pool *pool, Id dep)
-{
- while (ISRELDEP(dep))
- {
- Reldep *rd = rd = GETRELDEP(pool, dep);
- dep = rd->name;
- }
- return dep;
-}
-
int
solver_splitprovides(Solver *solv, Id dep)
{
{
Pool *pool = solv->pool;
int i, j;
- Id name, how, what, p, *pp;
+ Id how, what, p, *pp;
Solvable *s;
Repo *installed;
Rule *r;
break;
case SOLVER_ERASE_SOLVABLE_NAME: /* remove by capability */
case SOLVER_ERASE_SOLVABLE_PROVIDES:
- name = (how == SOLVER_ERASE_SOLVABLE_NAME) ? what : 0;
- while (ISRELDEP(name))
- {
- Reldep *rd = GETRELDEP(pool, name);
- name = rd->name;
- }
FOR_PROVIDES(p, pp, what)
{
- if (name && pool->solvables[p].name != name)
+ if (how == SOLVER_ERASE_SOLVABLE_NAME && !pool_match_nevr(pool, pool->solvables + p, what))
continue;
if (pool->solvables[p].repo == installed)
MAPSET(&solv->noupdate, p - installed->start);
break;
case SOLVER_ERASE_SOLVABLE_NAME: /* remove by capability */
case SOLVER_ERASE_SOLVABLE_PROVIDES:
- name = (how == SOLVER_ERASE_SOLVABLE_NAME) ? what : 0;
- while (ISRELDEP(name))
- {
- Reldep *rd = GETRELDEP(pool, name);
- name = rd->name;
- }
FOR_PROVIDES(p, pp, what)
{
- if (name && pool->solvables[p].name != name)
- continue;
+ if (how == SOLVER_ERASE_SOLVABLE_NAME && !pool_match_nevr(pool, pool->solvables + p, what))
+ continue;
if (pool->solvables[p].repo != installed)
continue;
if (MAPTST(&solv->noupdate, p - installed->start))
obsp = s->repo->idarraydata + s->obsoletes;
while ((obs = *obsp++) != 0)
{
- Id obsname = dep2name(pool, obs);
FOR_PROVIDES(p, pp, obs)
{
- if (!solv->obsoleteusesprovides && obsname != pool->solvables[p].name)
+ if (!solv->obsoleteusesprovides && !pool_match_nevr(pool, pool->solvables + p, obs))
continue;
addrule(solv, -n, -p);
}
obsp = s->repo->idarraydata + s->obsoletes;
while ((obs = *obsp++) != 0)
{
- Id obsname = dep2name(pool, obs);
FOR_PROVIDES(p, pp, obs)
{
if (p != -r->w2)
continue;
- if (!solv->obsoleteusesprovides && obsname != pool->solvables[p].name)
+ if (!solv->obsoleteusesprovides && !pool_match_nevr(pool, pool->solvables + p, obs))
continue;
*depp = obs;
*sourcep = -r->p;
obsp = s2->repo->idarraydata + s2->obsoletes;
while ((obs = *obsp++) != 0)
{
- Id obsname = dep2name(pool, obs);
FOR_PROVIDES(p, pp, obs)
{
if (p != -r->p)
continue;
- if (!solv->obsoleteusesprovides && obsname != pool->solvables[p].name)
+ if (!solv->obsoleteusesprovides && !pool_match_nevr(pool, pool->solvables + p, obs))
continue;
*depp = obs;
*sourcep = -r->w2;
obsp = s->repo->idarraydata + s->obsoletes;
while ((obs = *obsp++) != 0)
{
- Id obsname = dep2name(pool, obs);
FOR_PROVIDES(p, pp, obs)
{
if (pool->solvables[p].repo != installed)
continue;
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;
obsoletes[p - installed->start]++;
}
obsp = s->repo->idarraydata + s->obsoletes;
while ((obs = *obsp++) != 0)
{
- Id obsname = dep2name(pool, obs);
FOR_PROVIDES(p, pp, obs)
{
if (pool->solvables[p].repo != installed)
continue;
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;
p -= installed->start;
if (obsoletes_data[obsoletes[p]] != i)
int i;
int oldnrules;
Map addedmap; /* '1' == have rpm-rules for solvable */
- Id how, what, weak, name, p, *pp, d;
+ Id how, what, weak, p, *pp, d;
Queue q, redoq;
Solvable *s;
int goterase;
break;
case SOLVER_INSTALL_SOLVABLE_NAME:
case SOLVER_INSTALL_SOLVABLE_PROVIDES:
- name = (how == SOLVER_INSTALL_SOLVABLE_NAME) ? what : 0;
- while (ISRELDEP(name))
- {
- Reldep *rd = GETRELDEP(pool, name);
- name = rd->name;
- }
FOR_PROVIDES(p, pp, what)
{
/* if by name, ensure that the name matches */
- if (name && pool->solvables[p].name != name)
+ if (how == SOLVER_INSTALL_SOLVABLE_NAME && !pool_match_nevr(pool, pool->solvables + p, what))
continue;
addrpmrulesforsolvable(solv, pool->solvables + p, &addedmap);
}
if (how == SOLVER_INSTALL_SOLVABLE_PROVIDES)
POOL_DEBUG(SAT_DEBUG_JOB, "job: %sinstall provides %s\n", weak ? "weak " : "", dep2str(pool, what));
queue_empty(&q);
- name = (how == SOLVER_INSTALL_SOLVABLE_NAME) ? what : 0;
- while (ISRELDEP(name))
- {
- Reldep *rd = GETRELDEP(pool, name);
- name = rd->name;
- }
FOR_PROVIDES(p, pp, what)
{
/* if by name, ensure that the name matches */
- if (name && pool->solvables[p].name != name)
+ if (how == SOLVER_INSTALL_SOLVABLE_NAME && !pool_match_nevr(pool, pool->solvables + p, what))
continue;
queue_push(&q, p);
}
POOL_DEBUG(SAT_DEBUG_JOB, "job: %serase name %s\n", weak ? "weak " : "", dep2str(pool, what));
if (how == SOLVER_ERASE_SOLVABLE_PROVIDES)
POOL_DEBUG(SAT_DEBUG_JOB, "job: %serase provides %s\n", weak ? "weak " : "", dep2str(pool, what));
- name = (how == SOLVER_ERASE_SOLVABLE_NAME) ? what : 0;
- while (ISRELDEP(name))
- {
- Reldep *rd = GETRELDEP(pool, name);
- name = rd->name;
- }
FOR_PROVIDES(p, pp, what)
{
/* if by name, ensure that the name matches */
- if (name && pool->solvables[p].name != name)
+ if (how == SOLVER_ERASE_SOLVABLE_NAME && !pool_match_nevr(pool, pool->solvables + p, what))
continue;
addrule(solv, -p, 0); /* add 'remove' rule */
queue_push(&solv->ruletojob, i);