加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-choice-rules-also-do-solver_choicerulecheck-for-package-downgrades.patch 1.75 KB
一键复制 编辑 原始数据 按行查看 历史
hanhuihui 提交于 2023-08-19 21:17 . fix requirement error
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;
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化