From 40dcc1ce53b11e8897b725a1af575421705f271c Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Tue, 17 May 2016 13:49:45 +0200 Subject: [PATCH] backport some bugfixes (RHBZ #1318662, RHBZ #1325471) Signed-off-by: Igor Gnatenko --- ...v_extend-arguments-in-repo_add_rpmmd.patch | 27 +++++++ ...handling-when-implicitobsoleteusesco.patch | 74 +++++++++++++++++++ libsolv.spec | 14 +++- 3 files changed, 114 insertions(+), 1 deletion(-) create mode 100644 0001-Fix-order-of-solv_extend-arguments-in-repo_add_rpmmd.patch create mode 100644 0001-Fix-supplements-handling-when-implicitobsoleteusesco.patch diff --git a/0001-Fix-order-of-solv_extend-arguments-in-repo_add_rpmmd.patch b/0001-Fix-order-of-solv_extend-arguments-in-repo_add_rpmmd.patch new file mode 100644 index 0000000..102c4a9 --- /dev/null +++ b/0001-Fix-order-of-solv_extend-arguments-in-repo_add_rpmmd.patch @@ -0,0 +1,27 @@ +From 599c58bed474c2a68109ff0649f1effa7ff02c45 Mon Sep 17 00:00:00 2001 +From: Michael Schroeder +Date: Tue, 17 May 2016 11:22:56 +0200 +Subject: [PATCH] Fix order of solv_extend arguments in repo_add_rpmmd + +Fixes libsolv sometimes segfaulting since commit +d06562f7b70f6ceb7d52e717efd1963ce6e8ecf0 +--- + ext/repo_rpmmd.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ext/repo_rpmmd.c b/ext/repo_rpmmd.c +index 78264cc..d280ba0 100644 +--- a/ext/repo_rpmmd.c ++++ b/ext/repo_rpmmd.c +@@ -657,7 +657,7 @@ put_in_cshash(struct parsedata *pd, const unsigned char *key, int keyl, Id id) + } + } + /* a new entry. put in csdata */ +- pd->csdata = solv_extend(pd->csdata, pd->ncsdata, 1, 1 + keyl + sizeof(Id), 4095); ++ pd->csdata = solv_extend(pd->csdata, pd->ncsdata, 1 + keyl + sizeof(Id), 1, 4095); + d = pd->csdata + pd->ncsdata; + d[0] = keyl - 1; + memcpy(d + 1, key, keyl); +-- +2.7.4 + diff --git a/0001-Fix-supplements-handling-when-implicitobsoleteusesco.patch b/0001-Fix-supplements-handling-when-implicitobsoleteusesco.patch new file mode 100644 index 0000000..6619174 --- /dev/null +++ b/0001-Fix-supplements-handling-when-implicitobsoleteusesco.patch @@ -0,0 +1,74 @@ +From b1014a431541444bcd39c6ec83c1ec935c7f0aae Mon Sep 17 00:00:00 2001 +From: Michael Schroeder +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 ++#>=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 + diff --git a/libsolv.spec b/libsolv.spec index af211e8..e9ddf3b 100644 --- a/libsolv.spec +++ b/libsolv.spec @@ -49,13 +49,20 @@ Name: lib%{libname} Version: 0.6.20 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Package dependency solver License: BSD URL: https://github.com/openSUSE/libsolv Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz +# https://bugzilla.redhat.com/show_bug.cgi?id=1318662 +# https://github.com/openSUSE/libsolv/commit/599c58bed474c2a68109ff0649f1effa7ff02c45 +Patch0: 0001-Fix-order-of-solv_extend-arguments-in-repo_add_rpmmd.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=1325471 +# https://github.com/openSUSE/libsolv/commit/b1014a431541444bcd39c6ec83c1ec935c7f0aae +Patch1: 0001-Fix-supplements-handling-when-implicitobsoleteusesco.patch + BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: pkgconfig(rpm) @@ -302,6 +309,11 @@ popd %endif %changelog +* Tue May 17 2016 Igor Gnatenko - 0.6.20-2 +- Backport patch to fix crashing on reading some repos (RHBZ #1318662) +- Backport patch to fix installing multilib packages with weak deps + (RHBZ #1325471) + * Sat Apr 09 2016 Igor Gnatenko - 0.6.20-1 - Update to 0.6.20