Skip to content

Commit

Permalink
Only disable infarch rules on erase if the package was in lock-step
Browse files Browse the repository at this point in the history
Fiexes issue #528
  • Loading branch information
mlschroe committed Apr 21, 2023
1 parent 634371f commit 5dc4f81
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion src/rules.c
Original file line number Diff line number Diff line change
Expand Up @@ -2367,6 +2367,31 @@ reenablerepopriorule(Solver *solv, Id name)
#define DISABLE_BLACK 4
#define DISABLE_REPOPRIO 5

/* check if installed package p is in lock-step with another installed package */
static int
installed_is_in_lockstep(Solver *solv, Id p)
{
Pool *pool = solv->pool;
Repo *installed = solv->installed;
int rid;
Id pp, l;
Rule *r;

if (!installed)
return 0;
for (rid = solv->infarchrules, r = solv->rules + rid; rid < solv->infarchrules_end; rid++, r++)
{
if (r->p >= 0)
continue;
if (pool->solvables[-r->p].repo != installed)
continue;
FOR_RULELITERALS(l, pp, r)
if (l == p)
return 1;
}
return 0;
}

static void
jobtodisablelist(Solver *solv, Id how, Id what, Queue *q)
{
Expand Down Expand Up @@ -2612,7 +2637,8 @@ jobtodisablelist(Solver *solv, Id how, Id what, Queue *q)
{
queue_push2(q, DISABLE_UPDATE, p);
if ((set & SOLVER_SETARCH) != 0 && pool->implicitobsoleteusescolors && solv->infarchrules != solv->infarchrules_end)
queue_push2(q, DISABLE_INFARCH, pool->solvables[p].name); /* allow to break the lock-step */
if (installed_is_in_lockstep(solv, p))
queue_push2(q, DISABLE_INFARCH, pool->solvables[p].name); /* allow to break the lock-step */
#ifdef ENABLE_LINKED_PKGS
if (solv->instbuddy && solv->instbuddy[p - installed->start] > 1)
queue_push2(q, DISABLE_UPDATE, solv->instbuddy[p - installed->start]);
Expand Down

0 comments on commit 5dc4f81

Please sign in to comment.