diff options
author | Alejandro del Castillo <alejandro.delcastillo@ni.com> | 2019-02-07 09:57:58 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-02-08 10:57:19 +0000 |
commit | df31968a4cc0076bd2f7143b2c9286c45845207c (patch) | |
tree | 3bd954cce20a8d554382febd9e02ff5350fff8c5 /meta/recipes-extended | |
parent | c76c50df6498d85e7a6254002ff8f5e0ef3e67f7 (diff) | |
download | poky-df31968a4cc0076bd2f7143b2c9286c45845207c.tar.gz |
libsolv: fix segfault when using SOLVER_DISFAVOR
Opkg --add-ignore-recommends use the flag SOLVER_DISFAVOR. If a package
is set to be ignored as a recommendee, but there are not other
recommends on the package graph, libsolv segfaults.
(From OE-Core rev: d3ee06845e18ecf94770ff0970c2a0d6631ed214)
Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended')
-rw-r--r-- | meta/recipes-extended/libsolv/libsolv/0001-solver_solve-only-disfavor-recommends-if-there-are-a.patch | 33 | ||||
-rw-r--r-- | meta/recipes-extended/libsolv/libsolv_0.7.3.bb | 4 |
2 files changed, 36 insertions, 1 deletions
diff --git a/meta/recipes-extended/libsolv/libsolv/0001-solver_solve-only-disfavor-recommends-if-there-are-a.patch b/meta/recipes-extended/libsolv/libsolv/0001-solver_solve-only-disfavor-recommends-if-there-are-a.patch new file mode 100644 index 0000000000..139613a0ad --- /dev/null +++ b/meta/recipes-extended/libsolv/libsolv/0001-solver_solve-only-disfavor-recommends-if-there-are-a.patch | |||
@@ -0,0 +1,33 @@ | |||
1 | From 19d7cc87adba92d31d5fafdf7db00920d24a96a6 Mon Sep 17 00:00:00 2001 | ||
2 | From: Alejandro del Castillo <alejandro.delcastillo@ni.com> | ||
3 | Date: Wed, 6 Feb 2019 13:24:04 -0600 | ||
4 | Subject: [PATCH] solver_solve: only disfavor recommends if there are any | ||
5 | |||
6 | In a repo that have pkg 'a' and 'b' available, and 'b' is disfavored, | ||
7 | but 'a' doesn't recommend 'b', libsolv segfaults on | ||
8 | solver_addrecommendsrules, since solv->recommendsruleq is null. Only | ||
9 | call solver_addrecommendsrules if there are recommends rules. | ||
10 | |||
11 | Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com> | ||
12 | |||
13 | Upstream-Status: Accepted | ||
14 | --- | ||
15 | src/solver.c | 2 +- | ||
16 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
17 | |||
18 | diff --git a/src/solver.c b/src/solver.c | ||
19 | index a80090d19..ad78327a8 100644 | ||
20 | --- a/src/solver.c | ||
21 | +++ b/src/solver.c | ||
22 | @@ -3920,7 +3920,7 @@ solver_solve(Solver *solv, Queue *job) | ||
23 | else | ||
24 | solv->yumobsrules = solv->yumobsrules_end = solv->nrules; | ||
25 | |||
26 | - if (solv->havedisfavored && solv->strongrecommends) | ||
27 | + if (solv->havedisfavored && solv->strongrecommends && solv->recommendsruleq) | ||
28 | solver_addrecommendsrules(solv); | ||
29 | else | ||
30 | solv->recommendsrules = solv->recommendsrules_end = solv->nrules; | ||
31 | -- | ||
32 | 2.20.1 | ||
33 | |||
diff --git a/meta/recipes-extended/libsolv/libsolv_0.7.3.bb b/meta/recipes-extended/libsolv/libsolv_0.7.3.bb index 44757ac54f..3fe6f2c20a 100644 --- a/meta/recipes-extended/libsolv/libsolv_0.7.3.bb +++ b/meta/recipes-extended/libsolv/libsolv_0.7.3.bb | |||
@@ -7,7 +7,9 @@ LIC_FILES_CHKSUM = "file://LICENSE.BSD;md5=62272bd11c97396d4aaf1c41bc11f7d8" | |||
7 | 7 | ||
8 | DEPENDS = "expat zlib" | 8 | DEPENDS = "expat zlib" |
9 | 9 | ||
10 | SRC_URI = "git://github.com/openSUSE/libsolv.git" | 10 | SRC_URI = "git://github.com/openSUSE/libsolv.git \ |
11 | file://0001-solver_solve-only-disfavor-recommends-if-there-are-a.patch \ | ||
12 | " | ||
11 | 13 | ||
12 | SRCREV = "dc7d0f1c3113f2c8217563166906bef3eb5d1ee1" | 14 | SRCREV = "dc7d0f1c3113f2c8217563166906bef3eb5d1ee1" |
13 | UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+)" | 15 | UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+)" |