From 8aaaf8c2a7d51438c98eeca604231ddfab990f4d Mon Sep 17 00:00:00 2001 From: Michael Schroeder Date: Wed, 15 May 2013 12:03:48 +0200 Subject: [PATCH] fix multiversion handling when the update rule is an assertion --- src/solver.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/solver.c b/src/solver.c index 69fbc35..7f461de 100644 --- a/src/solver.c +++ b/src/solver.c @@ -1832,9 +1832,10 @@ solver_run_sat(Solver *solv, int disablerules, int doweak) for (pass = solv->updatemap.size ? 0 : 1; pass < 2; pass++) { int passlevel = level; + Id *multiversionupdaters = solv->multiversion.size ? solv->multiversionupdaters : 0; if (pass == 1) solv->decisioncnt_keep = solv->decisionq.count; - /* start with installedpos, the position that gave us problems last time */ + /* start with installedpos, the position that gave us problems the last time */ for (i = installedpos, n = installed->start; n < installed->end; i++, n++) { Rule *rr; @@ -1846,8 +1847,8 @@ solver_run_sat(Solver *solv, int disablerules, int doweak) if (s->repo != installed) continue; - if (solv->decisionmap[i] > 0) - continue; + if (solv->decisionmap[i] > 0 && (!multiversionupdaters || !multiversionupdaters[i - installed->start])) + continue; /* already decided */ if (!pass && solv->updatemap.size && !MAPTST(&solv->updatemap, i - installed->start)) continue; /* updates first */ r = solv->rules + solv->updaterules + (i - installed->start); @@ -1859,18 +1860,17 @@ solver_run_sat(Solver *solv, int disablerules, int doweak) if (!rr->p) continue; /* orpaned package */ - /* XXX: noupdate check is probably no longer needed, as all jobs should - * already be satisfied */ - /* Actually we currently still need it because of erase jobs */ - /* if noupdate is set we do not look at update candidates */ + /* check if we should update this package to the latest version + * noupdate is set for erase jobs, in that case we want to deinstall + * the installed package and not replace it with a newer version */ queue_empty(&dq); if (!MAPTST(&solv->noupdate, i - installed->start) && (solv->decisionmap[i] < 0 || solv->updatemap_all || (solv->updatemap.size && MAPTST(&solv->updatemap, i - installed->start)) || rr->p != i)) { - if (solv->multiversion.size && solv->multiversionupdaters - && (d = solv->multiversionupdaters[i - installed->start]) != 0) + if (multiversionupdaters && (d = multiversionupdaters[i - installed->start]) != 0) { /* special multiversion handling, make sure best version is chosen */ - queue_push(&dq, i); + if (rr->p == i && solv->decisionmap[i] >= 0) + queue_push(&dq, i); while ((p = pool->whatprovidesdata[d++]) != 0) if (solv->decisionmap[p] >= 0) queue_push(&dq, p); @@ -1893,7 +1893,7 @@ solver_run_sat(Solver *solv, int disablerules, int doweak) } else { - /* update to best package */ + /* update to best package of the update rule */ FOR_RULELITERALS(p, pp, rr) { if (solv->decisionmap[p] > 0) -- 2.7.4