libsolv/0001-Fix-supplements-handling-when-implicitobsoleteusesco.patch
Igor Gnatenko 40dcc1ce53 backport some bugfixes (RHBZ #1318662, RHBZ #1325471)
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
2016-05-17 13:49:45 +02:00

75 lines
2.2 KiB
Diff

From b1014a431541444bcd39c6ec83c1ec935c7f0aae Mon Sep 17 00:00:00 2001
From: Michael Schroeder <mls@suse.de>
Date: Tue, 17 May 2016 13:31:58 +0200
Subject: [PATCH] Fix supplements handling when implicitobsoleteusescolors is
set
This currently relys on the infarch lockstep handling a bit. Let's
see if this is enough or we need some better filtering code.
---
src/solver.c | 20 ++++++++++++++++++++
.../supplements_implicitobsoleteusescolors.t | 20 ++++++++++++++++++++
2 files changed, 40 insertions(+)
create mode 100644 test/testcases/weakdeps/supplements_implicitobsoleteusescolors.t
diff --git a/src/solver.c b/src/solver.c
index 5da8529..4f849ec 100644
--- a/src/solver.c
+++ b/src/solver.c
@@ -2636,6 +2636,26 @@ solver_run_sat(Solver *solv, int disablerules, int doweak)
dqs.count = j;
}
+ /* implicitobsoleteusescolors doesn't mix well with supplements.
+ * filter supplemented packages where we already decided
+ * to install a different architecture */
+ if (dqs.count && pool->implicitobsoleteusescolors)
+ {
+ for (i = j = 0; i < dqs.count; i++)
+ {
+ Id p2, pp2;
+ p = dqs.elements[i];
+ s = pool->solvables + p;
+ FOR_PROVIDES(p2, pp2, s->name)
+ if (solv->decisionmap[p2] > 0 && pool->solvables[p2].name == s->name && pool->solvables[p2].arch != s->arch)
+ break;
+ if (p2)
+ continue; /* ignore this package */
+ dqs.elements[j++] = p;
+ }
+ dqs.count = j;
+ }
+
/* make dq contain both recommended and supplemented pkgs */
if (dqs.count)
{
diff --git a/test/testcases/weakdeps/supplements_implicitobsoleteusescolors.t b/test/testcases/weakdeps/supplements_implicitobsoleteusescolors.t
new file mode 100644
index 0000000..6de4544
--- /dev/null
+++ b/test/testcases/weakdeps/supplements_implicitobsoleteusescolors.t
@@ -0,0 +1,20 @@
+repo system 0 empty
+repo test 0 testtags <inline>
+#>=Ver: 2.0
+#>=Pkg: A 1 1 noarch
+#>=Pkg: B 1 1 x86_64
+#>=Sup: A
+#>=Pkg: B 1 1 i686
+#>=Sup: A
+#>=Pkg: A2 1 1 noarch
+#>=Pkg: B2 1 1 x86_64
+#>=Sup: A2
+#>=Req: XX
+#>=Pkg: B2 1 1 i686
+#>=Sup: A2
+system x86_64 * system
+poolflags implicitobsoleteusescolors
+job install name A
+
+nextjob
+job install name A2
--
2.7.4