fix requirement error
This commit is contained in:
parent
1f43668bc4
commit
571f9443ba
26
backport-Add-testcase-for-last-commit.patch
Normal file
26
backport-Add-testcase-for-last-commit.patch
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
From 47734e26d67ad236a29c160ff224fcb1910e3a6f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Michael Schroeder <mls@suse.de>
|
||||||
|
Date: Tue, 18 Apr 2023 12:36:40 +0200
|
||||||
|
Subject: [PATCH] Add testcase for last commit
|
||||||
|
|
||||||
|
---
|
||||||
|
test/testcases/cplxdeps/ifelse_rec.t | 10 ++++++++++
|
||||||
|
1 file changed, 10 insertions(+)
|
||||||
|
create mode 100644 test/testcases/cplxdeps/ifelse_rec.t
|
||||||
|
|
||||||
|
diff --git a/test/testcases/cplxdeps/ifelse_rec.t b/test/testcases/cplxdeps/ifelse_rec.t
|
||||||
|
new file mode 100644
|
||||||
|
index 000000000..ea467027c
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/test/testcases/cplxdeps/ifelse_rec.t
|
||||||
|
@@ -0,0 +1,10 @@
|
||||||
|
+repo appstream 0 testtags <inline>
|
||||||
|
+#>=Pkg: xorg-x11-server-Xorg 1.20.11 18.el9 noarch
|
||||||
|
+#>=Req: missing-req
|
||||||
|
+#>=Pkg: pass 1.7.4 6.el9 noarch
|
||||||
|
+#>=Rec: xclip <IF> (xorg-x11-server-Xorg <ELSE> wl-clipboard)
|
||||||
|
+repo @System 0 empty
|
||||||
|
+system unset * @System
|
||||||
|
+job install pkg pass-1.7.4-6.el9.noarch@appstream
|
||||||
|
+result transaction,problems <inline>
|
||||||
|
+#>install pass-1.7.4-6.el9.noarch@appstream
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
From 1edb35a3bd9abcede3a200471a4d1868f8054c99 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Michael Schroeder <mls@suse.de>
|
||||||
|
Date: Tue, 18 Apr 2023 11:57:50 +0200
|
||||||
|
Subject: [PATCH] Treat condition both as positive and negative literal in
|
||||||
|
pool_add_pos_literals_complex_dep
|
||||||
|
|
||||||
|
That's because (A IF B ELSE C) gets rewritten to (A OR ~B) AND (C OR B) and
|
||||||
|
(A UNLESS B ELSE C) gets rewritten to (A AND ~B) OR (C AND B). In both
|
||||||
|
cases we have A, B, ~B, C.
|
||||||
|
|
||||||
|
This resolves issue #527
|
||||||
|
---
|
||||||
|
src/cplxdeps.c | 1 +
|
||||||
|
1 file changed, 1 insertion(+)
|
||||||
|
|
||||||
|
diff --git a/src/cplxdeps.c b/src/cplxdeps.c
|
||||||
|
index 6c40752e2..26e754d95 100644
|
||||||
|
--- a/src/cplxdeps.c
|
||||||
|
+++ b/src/cplxdeps.c
|
||||||
|
@@ -405,6 +405,7 @@ pool_add_pos_literals_complex_dep(Pool *pool, Id dep, Queue *q, Map *m, int neg)
|
||||||
|
Reldep *rd2 = GETRELDEP(pool, rd->evr);
|
||||||
|
if (rd2->flags == REL_ELSE)
|
||||||
|
{
|
||||||
|
+ pool_add_pos_literals_complex_dep(pool, rd2->name, q, m, !neg);
|
||||||
|
pool_add_pos_literals_complex_dep(pool, rd2->evr, q, m, !neg);
|
||||||
|
dep = rd2->name;
|
||||||
|
}
|
||||||
@ -0,0 +1,50 @@
|
|||||||
|
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;
|
||||||
13
libsolv.spec
13
libsolv.spec
@ -15,13 +15,16 @@
|
|||||||
|
|
||||||
Name: libsolv
|
Name: libsolv
|
||||||
Version: 0.7.22
|
Version: 0.7.22
|
||||||
Release: 1
|
Release: 2
|
||||||
Summary: Package dependency solver
|
Summary: Package dependency solver
|
||||||
License: BSD
|
License: BSD
|
||||||
URL: https://github.com/openSUSE/libsolv
|
URL: https://github.com/openSUSE/libsolv
|
||||||
Source: https://github.com/openSUSE/libsolv/archive/refs/tags/%{version}.tar.gz
|
Source: https://github.com/openSUSE/libsolv/archive/refs/tags/%{version}.tar.gz
|
||||||
|
|
||||||
Patch0: Fix-memory-leak-when-using-testsolv-to-execute-cases.patch
|
Patch0: Fix-memory-leak-when-using-testsolv-to-execute-cases.patch
|
||||||
|
Patch6001: backport-Treat-condition-both-as-positive-and-negative-literal-in-pool_add_pos_literals_complex_dep.patch
|
||||||
|
Patch6002: backport-Add-testcase-for-last-commit.patch
|
||||||
|
Patch6003: backport-choice-rules-also-do-solver_choicerulecheck-for-package-downgrades.patch
|
||||||
|
|
||||||
BuildRequires: cmake gcc-c++ ninja-build pkgconfig(rpm) zlib-devel
|
BuildRequires: cmake gcc-c++ ninja-build pkgconfig(rpm) zlib-devel
|
||||||
BuildRequires: libxml2-devel xz-devel bzip2-devel
|
BuildRequires: libxml2-devel xz-devel bzip2-devel
|
||||||
@ -215,6 +218,12 @@ Python 3 version.
|
|||||||
%{_mandir}/man3/%{name}*.3*
|
%{_mandir}/man3/%{name}*.3*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Sat Aug 19 2023 hanhuihui<hanhuihui5@huawei.com> - 0.7.22-2
|
||||||
|
- Type:bugfix
|
||||||
|
- ID:NA
|
||||||
|
- SUG:NA
|
||||||
|
- DESC:fix requirement error
|
||||||
|
|
||||||
* Tue Nov 8 2022 hanhuihui<hanhuihui5@huawei.com> - 0.7.22-1
|
* Tue Nov 8 2022 hanhuihui<hanhuihui5@huawei.com> - 0.7.22-1
|
||||||
- Type:bugfix
|
- Type:bugfix
|
||||||
- ID:NA
|
- ID:NA
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user