Backport patch

Resolves: rhbz#2190136
This commit is contained in:
Jaroslav Rohel 2023-05-17 09:20:54 +02:00
parent fd32601e81
commit 63e08ac89c
2 changed files with 66 additions and 1 deletions

View File

@ -0,0 +1,60 @@
From 91125fe786cb6de2f050430fa51e11c501f17aed 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 6c40752e..26e754d9 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;
}
--
2.40.1
From 11fac9a31e892125e19246101b5604322836467d 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 00000000..ea467027
--- /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
--
2.40.1

View File

@ -37,7 +37,7 @@
Name: lib%{libname}
Version: 0.7.20
Release: 4%{?dist}
Release: 5%{?dist}
Summary: Package dependency solver
License: BSD
@ -51,6 +51,7 @@ Source: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
Patch1: 0001-Add-support-for-computing-hashes-using-OpenSSL.patch
Patch2: 0002-Add-support-for-storing-user-data-in-a-solv-file.patch
Patch3: 0003-Allow-accessing-toolversion-at-runtime-and-increase-.patch
Patch4: 0004-Treat-condition-both-as-positive-and-negative-litera.patch
BuildRequires: cmake
BuildRequires: gcc-c++
@ -279,6 +280,10 @@ export LD_LIBRARY_PATH=%{buildroot}%{_libdir}
%endif
%changelog
* Wed May 17 2023 Jaroslav Rohel <jrohel@redhat.com> - 0.7.20-5
- Backport Treat condition both as positive and negative literal in pool_add_pos_literals_complex_dep
(RhBug:2185061,2190136)
* Wed Dec 07 2022 Nicola Sella <nsella@redhat.com> - 0.7.20-4
- Drop patch to fix pick of old build (RhBug:2150300,RhBug:2151551)