Projects
Eulaceura:Factory
libsolv
_service:obs_scm:backport-choice-rules-also-do-...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:backport-choice-rules-also-do-solver_choicerulecheck-for-package-downgrades.patch of Package libsolv
From 2c85ed581422e072ad95119f3d7dc19eb45f29ac Mon Sep 17 00:00:00 2001 From: Michael Schroeder <mls@suse.de> Date: Fri, 19 May 2023 15:17:53 +0200 Subject: [PATCH] choice rules: also do solver_choicerulecheck for package downgrades Fixes issue #514 --- src/rules.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/rules.c b/src/rules.c index 660656f01..7d57cfdee 100644 --- a/src/rules.c +++ b/src/rules.c @@ -3449,6 +3449,7 @@ solver_addchoicerules(Solver *solv) int lastaddedcnt; unsigned int now; int isinstalled; + int dodowngradecheck = solv->allowdowngrade; solv->choicerules = solv->nrules; if (!pool->installed) @@ -3457,6 +3458,8 @@ solver_addchoicerules(Solver *solv) return; } now = solv_timems(0); + if ((solv->dupinvolvedmap_all || solv->dupinvolvedmap.size) && solv->dup_allowdowngrade) + dodowngradecheck = 1; queue_init(&q); queue_init(&qi); queue_init(&qcheck); @@ -3532,8 +3535,16 @@ solver_addchoicerules(Solver *solv) /* do extra checking for packages related to installed packages */ for (i = j = 0; i < qi.count; i += 2) { + int isdowngrade = 0; p2 = qi.elements[i]; - if (solv->updatemap_all || (solv->updatemap.size && MAPTST(&solv->updatemap, p2 - solv->installed->start))) + if (dodowngradecheck) + { + p = qi.elements[i + 1]; + if (pool->solvables[p2].name == pool->solvables[p].name) + if (pool_evrcmp(pool, pool->solvables[p2].evr, pool->solvables[p].evr, EVRCMP_COMPARE) > 0) + isdowngrade = 1; + } + if (isdowngrade || solv->updatemap_all || (solv->updatemap.size && MAPTST(&solv->updatemap, p2 - solv->installed->start))) { if (solver_choicerulecheck(solv, p2, r, &m, &qcheck)) continue;
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2