From: Michael Schroeder Date: Wed, 22 Mar 2017 10:17:54 +0000 (+0100) Subject: Add missing part from last commit X-Git-Tag: 0.6.27~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=668e2495d942e888403f47cd5ce140703a6bb3e1;p=thirdparty%2Flibsolv.git Add missing part from last commit --- diff --git a/src/rules.c b/src/rules.c index 3413c496..26b93ea6 100644 --- a/src/rules.c +++ b/src/rules.c @@ -3552,6 +3552,7 @@ solver_addbestrules(Solver *solv, int havebestinstalljobs) if (solv->allowuninstall || solv->allowuninstall_all || (solv->allowuninstallmap.size && MAPTST(&solv->allowuninstallmap, p - installed->start))) { /* package is flagged both for allowuninstall and best, add negative rules */ + d = q.count == 1 ? q.elements[0] : -pool_queuetowhatprovides(pool, &q); for (i = 0; i < q.count; i++) MAPSET(&m, q.elements[i]); r = solv->rules + solv->featurerules + (p - installed->start); @@ -3561,7 +3562,10 @@ solver_addbestrules(Solver *solv, int havebestinstalljobs) { if (MAPTST(&m, p2)) continue; - solver_addrule(solv, -p2, 0, 0); + if (d >= 0) + solver_addrule(solv, -p2, d, 0); + else + solver_addrule(solv, -p2, 0, -d); queue_push(&r2pkg, p); } for (i = 0; i < q.count; i++)