From: Michael Schroeder Date: Tue, 8 Oct 2019 11:40:45 +0000 (+0200) Subject: Fix handling of disabled installed packages in distupgrade X-Git-Tag: 0.7.7~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=954862319e32e97b20afd0f598cd461ece320e4f;p=thirdparty%2Flibsolv.git Fix handling of disabled installed packages in distupgrade Such packages must not be touched, i.e. they must stay installed. --- diff --git a/src/pool.c b/src/pool.c index d2053b9c..76636a78 100644 --- a/src/pool.c +++ b/src/pool.c @@ -455,7 +455,6 @@ pool_createwhatprovides(Pool *pool) Offset *whatprovides; Id *whatprovidesdata, *dp, *whatprovidesauxdata; Offset *whatprovidesaux; - Repo *installed = pool->installed; unsigned int now; now = solv_timems(0); diff --git a/src/rules.c b/src/rules.c index 4075b9d0..57895c01 100644 --- a/src/rules.c +++ b/src/rules.c @@ -1373,6 +1373,14 @@ solver_addupdaterule(Solver *solv, Solvable *s) int dupinvolved = 0; p = s - pool->solvables; + + if (pool->considered && pool_disabled_solvable(pool, s)) + { + /* disabled installed solvables must stay installed */ + solver_addrule(solv, p, 0, 0); + return; + } + /* Orphan detection. We cheat by looking at the feature rule, which * we already calculated */ r = solv->rules + solv->featurerules + (p - solv->installed->start); @@ -2003,6 +2011,8 @@ solver_addduprules(Solver *solv, Map *addedmap) continue; if (installed && ps->repo == installed) { + if (pool->considered && pool_disabled_solvable(pool, ps)) + continue; /* always keep disabled installed packages */ if (!MAPTST(&solv->dupmap, p)) { Id ip, ipp;