- addrule(solv, -what, 0); /* remove by Id */
- queue_push(&solv->ruletojob, i);
- if (weak)
- queue_push(&solv->weakruleq, solv->nrules - 1);
+ name = s->name;
+ if (solv->installed && s->repo == solv->installed)
+ {
+ FOR_PROVIDES(p, pp, s->name)
+ {
+ s = pool->solvables + p;
+ if (s->name != name)
+ continue;
+ if (p != what)
+ {
+ /* keep other versions installed */
+ if (s->repo == solv->installed)
+ continue;
+ /* keep installcandidates of other jobs */
+ if (MAPTST(&installcandidatemap, p))
+ continue;
+ }
+ addrule(solv, -p, 0); /* remove by Id */
+ queue_push(&solv->ruletojob, i);
+ if (weak)
+ queue_push(&solv->weakruleq, solv->nrules - 1);
+ }
+ }
+ else
+ {
+ addrule(solv, -what, 0); /* remove by Id */
+ queue_push(&solv->ruletojob, i);
+ if (weak)
+ queue_push(&solv->weakruleq, solv->nrules - 1);
+ }