]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
Fix supplements handling when implicitobsoleteusescolors is set
authorMichael Schroeder <mls@suse.de>
Tue, 17 May 2016 11:31:58 +0000 (13:31 +0200)
committerMichael Schroeder <mls@suse.de>
Tue, 17 May 2016 11:31:58 +0000 (13:31 +0200)
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
test/testcases/weakdeps/supplements_implicitobsoleteusescolors.t [new file with mode: 0644]

index 5da8529547eb35aac6befb5d0cc6f38b7d2c74cf..4f849ec6678053879a7bfcaaed9b8317878fc537 100644 (file)
@@ -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 (file)
index 0000000..6de4544
--- /dev/null
@@ -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