]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
Add a DISABLE_UPDATE entry if we need to disable a best rules
authorMichael Schroeder <mls@suse.de>
Tue, 13 Dec 2022 10:19:02 +0000 (11:19 +0100)
committerMichael Schroeder <mls@suse.de>
Tue, 13 Dec 2022 10:19:02 +0000 (11:19 +0100)
src/rules.c

index 010ed4a9af9762c23e09828f475f4b192fdf3e50..75198ec906d9a549192b7a26393bd344692c39fc 100644 (file)
@@ -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)
        {