diff --git a/SOURCES/0004-Treat-condition-both-as-positive-and-negative-litera.patch b/SOURCES/0004-Treat-condition-both-as-positive-and-negative-litera.patch new file mode 100644 index 0000000..4acb13b --- /dev/null +++ b/SOURCES/0004-Treat-condition-both-as-positive-and-negative-litera.patch @@ -0,0 +1,60 @@ +From 91125fe786cb6de2f050430fa51e11c501f17aed Mon Sep 17 00:00:00 2001 +From: Michael Schroeder +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 +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 ++#>=Pkg: xorg-x11-server-Xorg 1.20.11 18.el9 noarch ++#>=Req: missing-req ++#>=Pkg: pass 1.7.4 6.el9 noarch ++#>=Rec: xclip (xorg-x11-server-Xorg wl-clipboard) ++repo @System 0 empty ++system unset * @System ++job install pkg pass-1.7.4-6.el9.noarch@appstream ++result transaction,problems ++#>install pass-1.7.4-6.el9.noarch@appstream +-- +2.40.1 + diff --git a/SOURCES/0005-Allow_break_arch_lock_step_on_erase.patch b/SOURCES/0005-Allow_break_arch_lock_step_on_erase.patch new file mode 100644 index 0000000..b5b2907 --- /dev/null +++ b/SOURCES/0005-Allow_break_arch_lock_step_on_erase.patch @@ -0,0 +1,125 @@ +From 78b2d8148bea1dc12b854d9c11691d5f1bc33fd8 Mon Sep 17 00:00:00 2001 +From: Michael Schroeder +Date: Wed, 19 Apr 2023 13:09:10 +0200 +Subject: [PATCH] Allow to break arch lock-step on erase operations + +We allow it if SOLVER_SETARCH is (auto-)set in the erase job. +--- + src/rules.c | 26 ++++++++++++++++++++++++++ + 1 file changed, 26 insertions(+) + +diff --git a/src/rules.c b/src/rules.c +index 212df322..bbabc55f 100644 +--- a/src/rules.c ++++ b/src/rules.c +@@ -1668,6 +1668,16 @@ solver_addinfarchrules(Solver *solv, Map *addedmap) + if (first) + continue; /* not the first in the group */ + ++ if (!bestscore && allowedarchs.count > 1 && pool->implicitobsoleteusescolors) ++ { ++ for (j = 0; j < allowedarchs.count; j++) ++ { ++ a = pool_arch2score(pool, allowedarchs.elements[j]); ++ if (a && a != 1 && (!bestscore || a < bestscore)) ++ bestscore = a; ++ } ++ } ++ + if (!bestscore) + continue; /* did not find a score for this group */ + +@@ -2456,6 +2466,20 @@ jobtodisablelist(Solver *solv, Id how, Id what, Queue *q) + case SOLVER_ERASE: + if (!installed) + break; ++ set = how & SOLVER_SETMASK; ++ if (!(set & (SOLVER_NOAUTOSET | SOLVER_SETARCH)) && pool->implicitobsoleteusescolors && solv->infarchrules != solv->infarchrules_end) ++ { ++ if (select == SOLVER_SOLVABLE) ++ set |= SOLVER_SETARCH; ++ else if ((select == SOLVER_SOLVABLE_NAME || select == SOLVER_SOLVABLE_PROVIDES) && ISRELDEP(what)) ++ { ++ Reldep *rd = GETRELDEP(pool, what); ++ if (rd->flags <= 7 && ISRELDEP(rd->name)) ++ rd = GETRELDEP(pool, rd->name); ++ if (rd->flags == REL_ARCH) ++ set |= SOLVER_SETARCH; ++ } ++ } + if (select == SOLVER_SOLVABLE_ALL || (select == SOLVER_SOLVABLE_REPO && what == installed->repoid)) + { + FOR_REPO_SOLVABLES(installed, p, s) +@@ -2465,6 +2489,8 @@ jobtodisablelist(Solver *solv, Id how, Id what, Queue *q) + if (pool->solvables[p].repo == installed) + { + queue_push2(q, DISABLE_UPDATE, p); ++ if ((set & SOLVER_SETARCH) != 0 && pool->implicitobsoleteusescolors && solv->infarchrules != solv->infarchrules_end) ++ queue_push2(q, DISABLE_INFARCH, pool->solvables[p].name); /* allow to break the lock-step */ + #ifdef ENABLE_LINKED_PKGS + if (solv->instbuddy && solv->instbuddy[p - installed->start] > 1) + queue_push2(q, DISABLE_UPDATE, solv->instbuddy[p - installed->start]); +-- +2.40.1 + + +From dc4c91a71eda2950df11724945ebd5151883a041 Mon Sep 17 00:00:00 2001 +From: Michael Schroeder +Date: Fri, 21 Apr 2023 16:15:10 +0200 +Subject: [PATCH] Only disable infarch rules on erase if the package was in + lock-step + +Fiexes issue #528 +--- + src/rules.c | 28 +++++++++++++++++++++++++++- + 1 file changed, 27 insertions(+), 1 deletion(-) + +diff --git a/src/rules.c b/src/rules.c +index bbabc55f..c909ae0b 100644 +--- a/src/rules.c ++++ b/src/rules.c +@@ -2279,6 +2279,31 @@ solver_addblackrules(Solver *solv) + #define DISABLE_DUP 3 + #define DISABLE_BLACK 4 + ++/* check if installed package p is in lock-step with another installed package */ ++static int ++installed_is_in_lockstep(Solver *solv, Id p) ++{ ++ Pool *pool = solv->pool; ++ Repo *installed = solv->installed; ++ int rid; ++ Id pp, l; ++ Rule *r; ++ ++ if (!installed) ++ return 0; ++ for (rid = solv->infarchrules, r = solv->rules + rid; rid < solv->infarchrules_end; rid++, r++) ++ { ++ if (r->p >= 0) ++ continue; ++ if (pool->solvables[-r->p].repo != installed) ++ continue; ++ FOR_RULELITERALS(l, pp, r) ++ if (l == p) ++ return 1; ++ } ++ return 0; ++} ++ + static void + jobtodisablelist(Solver *solv, Id how, Id what, Queue *q) + { +@@ -2490,7 +2515,8 @@ jobtodisablelist(Solver *solv, Id how, Id what, Queue *q) + { + queue_push2(q, DISABLE_UPDATE, p); + if ((set & SOLVER_SETARCH) != 0 && pool->implicitobsoleteusescolors && solv->infarchrules != solv->infarchrules_end) +- queue_push2(q, DISABLE_INFARCH, pool->solvables[p].name); /* allow to break the lock-step */ ++ if (installed_is_in_lockstep(solv, p)) ++ queue_push2(q, DISABLE_INFARCH, pool->solvables[p].name); /* allow to break the lock-step */ + #ifdef ENABLE_LINKED_PKGS + if (solv->instbuddy && solv->instbuddy[p - installed->start] > 1) + queue_push2(q, DISABLE_UPDATE, solv->instbuddy[p - installed->start]); +-- +2.40.1 + diff --git a/SPECS/libsolv.spec b/SPECS/libsolv.spec index 7be3bff..1de2291 100644 --- a/SPECS/libsolv.spec +++ b/SPECS/libsolv.spec @@ -37,7 +37,7 @@ Name: lib%{libname} Version: 0.7.20 -Release: 4%{?dist} +Release: 6%{?dist} Summary: Package dependency solver License: BSD @@ -51,6 +51,8 @@ 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 +Patch5: 0005-Allow_break_arch_lock_step_on_erase.patch BuildRequires: cmake BuildRequires: gcc-c++ @@ -279,8 +281,15 @@ export LD_LIBRARY_PATH=%{buildroot}%{_libdir} %endif %changelog -* Mon Dec 12 2022 Nicola Sella - 0.7.20-4 -- Drop patch to fix pick of old build (RhBug:2151895) +* Wed Jun 21 2023 Jaroslav Rohel - 0.7.20-6 +- Backport Allow to break arch lock-step on erase operations (RhBug:2172288,2172292) + +* Wed May 17 2023 Jaroslav Rohel - 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 - 0.7.20-4 +- Drop patch to fix pick of old build (RhBug:2150300,RhBug:2151551) * Thu May 05 2022 Lukas Hrazky - 0.7.20-3 - Allow accessing toolversion at runtime and increase it