From: Michael Schroeder Date: Fri, 26 Oct 2007 11:00:22 +0000 (+0000) Subject: treat 'nothing provides' jobrules in a sane way X-Git-Tag: BASE-SuSE-Code-12_1-Branch~308^2~890 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7699f8751dbd1bfde35557858b477f43787ab05e;p=thirdparty%2Flibsolv.git treat 'nothing provides' jobrules in a sane way --- diff --git a/src/solver.c b/src/solver.c index f147b962..5f4835f2 100644 --- a/src/solver.c +++ b/src/solver.c @@ -2762,26 +2762,25 @@ solve(Solver *solv, Queue *job) queuepush(&solv->ruletojob, i); break; case SOLVER_ERASE_SOLVABLE: - addrule(solv, -what, 0); /* remove by Id */ + addrule(solv, -what, 0); /* remove by Id */ queuepush(&solv->ruletojob, i); MAPSET(&noupdaterule, what); break; - case SOLVER_INSTALL_SOLVABLE_NAME: /* install by capability */ + case SOLVER_INSTALL_SOLVABLE_NAME: /* install by capability */ case SOLVER_INSTALL_SOLVABLE_PROVIDES: QUEUEEMPTY(&q); - FOR_PROVIDES(p, pp, what) /* check all providers */ + FOR_PROVIDES(p, pp, what) { - /* if by name, ensure that the name matches */ + /* if by name, ensure that the name matches */ if (how == SOLVER_INSTALL_SOLVABLE_NAME && pool->solvables[p].name != what) continue; queuepush(&q, p); } - if (!q.count) { /* no provider found -> abort */ - fprintf(stderr, "Nothing provides '%s'\n", id2str(pool, what)); - /* XXX make this a problem! */ - return; - abort(); - } + if (!q.count) + { + /* no provider, make this an impossible rule */ + queuepush(&q, -SYSTEMSOLVABLE); + } p = queueshift(&q); /* get first provider */ if (!q.count)