]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
Extend the job to the install buddy for erase and lock jobs
authorMichael Schroeder <mls@suse.de>
Thu, 27 Jun 2019 14:34:09 +0000 (16:34 +0200)
committerMichael Schroeder <mls@suse.de>
Thu, 27 Jun 2019 14:34:09 +0000 (16:34 +0200)
This is needed so that a cleandeps erase of a pattern propagates
to the packages, as pattern packages are automagically marked
as userinstalled.

src/solver.c

index 7e8693c3a6d29105ddd1d4ea2222e10159a0898e..b94a779a109b9d16f202c9ea89e0aa6f2b7f7501 100644 (file)
@@ -3810,6 +3810,10 @@ solver_solve(Solver *solv, Queue *job)
                  name_s = s;
                }
              solver_addjobrule(solv, -p, 0, 0, i, weak);
+#ifdef ENABLE_LINKED_PKGS
+             if (solv->instbuddy && installed && s->repo == installed && solv->instbuddy[p - installed->start] > 1)
+               solver_addjobrule(solv, -solv->instbuddy[p - installed->start], 0, 0, i, weak);
+#endif
            }
          /* special case for "erase a specific solvable": we also
           * erase all other solvables with that name, so that they
@@ -3877,7 +3881,14 @@ solver_solve(Solver *solv, Queue *job)
                }
            }
          FOR_JOB_SELECT(p, pp, select, what)
-           solver_addjobrule(solv, installed && pool->solvables[p].repo == installed ? p : -p, 0, 0, i, weak);
+           {
+             s = pool->solvables + p;
+             solver_addjobrule(solv, installed && s->repo == installed ? p : -p, 0, 0, i, weak);
+#ifdef ENABLE_LINKED_PKGS
+             if (solv->instbuddy && installed && s->repo == installed && solv->instbuddy[p - installed->start] > 1)
+               solver_addjobrule(solv, solv->instbuddy[p - installed->start], 0, 0, i, weak);
+#endif
+           }
          break;
        case SOLVER_DISTUPGRADE:
          POOL_DEBUG(SOLV_DEBUG_JOB, "job: distupgrade %s\n", solver_select2str(pool, select, what));