From: Michael Schroeder Date: Tue, 13 Dec 2022 10:19:02 +0000 (+0100) Subject: Add a DISABLE_UPDATE entry if we need to disable a best rules X-Git-Tag: 0.7.23~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=73415322c120926121693caeeba22b5f6ed0dc1a;p=thirdparty%2Flibsolv.git Add a DISABLE_UPDATE entry if we need to disable a best rules --- diff --git a/src/rules.c b/src/rules.c index 010ed4a9..75198ec9 100644 --- a/src/rules.c +++ b/src/rules.c @@ -2485,6 +2485,20 @@ jobtodisablelist(Solver *solv, Id how, Id what, Queue *q) return; /* now the hard part: disable some update rules */ + /* if the job asks for a single solvable to stay, disable the update rule */ + if (select == SOLVER_SOLVABLE && pool->solvables[what].repo == installed && solv->bestrules_info) + if ((set & (SOLVER_SETEVR | SOLVER_SETARCH | SOLVER_SETVENDOR)) == (SOLVER_SETEVR | SOLVER_SETARCH | SOLVER_SETVENDOR)) + { + int ni = solv->bestrules_end - solv->bestrules; + for (i = solv->bestrules_up - solv->bestrules; i < ni; i++) + if (solv->bestrules_info[i] == what) + { + queue_push2(q, DISABLE_UPDATE, what); /* will also disable the best rule */ + break; + } + return; + } + /* first check if we have installed or multiversion packages in the job */ FOR_JOB_SELECT(p, pp, select, what) {