代码拉取完成,页面将自动刷新
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;
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。