diff options
Diffstat (limited to 'poky/meta/recipes-extended/libsolv')
-rw-r--r-- | poky/meta/recipes-extended/libsolv/libsolv/0001-Add-fallback-fopencookie-implementation.patch | 251 | ||||
-rw-r--r-- | poky/meta/recipes-extended/libsolv/libsolv/0001-build-use-GNUInstallDirs.patch | 188 | ||||
-rw-r--r-- | poky/meta/recipes-extended/libsolv/libsolv/0001-solver_solve-only-disfavor-recommends-if-there-are-a.patch | 33 | ||||
-rw-r--r-- | poky/meta/recipes-extended/libsolv/libsolv/0002-Fixes-to-internal-fopencookie-implementation.patch | 105 | ||||
-rw-r--r-- | poky/meta/recipes-extended/libsolv/libsolv_0.7.3.bb (renamed from poky/meta/recipes-extended/libsolv/libsolv_0.6.35.bb) | 12 |
5 files changed, 227 insertions, 362 deletions
diff --git a/poky/meta/recipes-extended/libsolv/libsolv/0001-Add-fallback-fopencookie-implementation.patch b/poky/meta/recipes-extended/libsolv/libsolv/0001-Add-fallback-fopencookie-implementation.patch deleted file mode 100644 index e5cb60dd5..000000000 --- a/poky/meta/recipes-extended/libsolv/libsolv/0001-Add-fallback-fopencookie-implementation.patch +++ /dev/null @@ -1,251 +0,0 @@ -From 47c6f1b4332a9e4935c48cca826786a6b8fe6f59 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Neal=20Gompa=20=28=E3=83=8B=E3=83=BC=E3=83=AB=E3=83=BB?= - =?UTF-8?q?=E3=82=B3=E3=82=99=E3=83=B3=E3=83=8F=E3=82=9A=29?= - <ngompa13@gmail.com> -Date: Wed, 11 Nov 2015 20:32:17 -0500 -Subject: [PATCH 1/2] Add fallback fopencookie() implementation - -In environments where neither fopencookie() nor funopen() -are implemented, we need to provide a suitable implementation -of fopencookie() that we can use. - -Alex Kanavin: rebased CMakeLists.txt change to apply to latest upstream code. - -Upstream-Status: Denied [https://github.com/openSUSE/libsolv/pull/112] -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> - ---- - ext/CMakeLists.txt | 7 ++ - ext/solv_xfopen.c | 10 +-- - ext/solv_xfopen_fallback_fopencookie.c | 123 +++++++++++++++++++++++++++++++++ - ext/solv_xfopen_fallback_fopencookie.h | 28 ++++++++ - 4 files changed, 164 insertions(+), 4 deletions(-) - create mode 100644 ext/solv_xfopen_fallback_fopencookie.c - create mode 100644 ext/solv_xfopen_fallback_fopencookie.h - -diff --git a/ext/CMakeLists.txt b/ext/CMakeLists.txt -index b8917a2..fac6c32 100644 ---- a/ext/CMakeLists.txt -+++ b/ext/CMakeLists.txt -@@ -4,6 +4,13 @@ SET (libsolvext_SRCS - SET (libsolvext_HEADERS - tools_util.h solv_xfopen.h testcase.h) - -+IF (NOT HAVE_FOPENCOOKIE AND NOT HAVE_FUNOPEN) -+ SET (libsolvext_SRCS ${libsolvext_SRCS} -+ solv_xfopen_fallback_fopencookie.c) -+ SET (libsolvext_HEADERS ${libsolvext_HEADERS} -+ solv_xfopen_fallback_fopencookie.h) -+ENDIF (NOT HAVE_FOPENCOOKIE AND NOT HAVE_FUNOPEN) -+ - IF (ENABLE_RPMDB OR ENABLE_RPMPKG) - SET (libsolvext_SRCS ${libsolvext_SRCS} - pool_fileconflicts.c repo_rpmdb.c) -diff --git a/ext/solv_xfopen.c b/ext/solv_xfopen.c -index 2c64bb6..eb3a3ad 100644 ---- a/ext/solv_xfopen.c -+++ b/ext/solv_xfopen.c -@@ -12,6 +12,10 @@ - #include <string.h> - #include <fcntl.h> - -+#if !defined(HAVE_FUNOPEN) && !defined(HAVE_FOPENCOOKIE) -+#include "solv_xfopen_fallback_fopencookie.h" -+#endif -+ - #include "solv_xfopen.h" - #include "util.h" - -@@ -21,7 +25,7 @@ static FILE *cookieopen(void *cookie, const char *mode, - ssize_t (*cwrite)(void *, const char *, size_t), - int (*cclose)(void *)) - { --#ifdef HAVE_FUNOPEN -+#if defined(HAVE_FUNOPEN) && !defined(HAVE_FOPENCOOKIE) - if (!cookie) - return 0; - return funopen(cookie, -@@ -30,7 +34,7 @@ static FILE *cookieopen(void *cookie, const char *mode, - (fpos_t (*)(void *, fpos_t, int))NULL, /* seekfn */ - cclose - ); --#elif defined(HAVE_FOPENCOOKIE) -+#else - cookie_io_functions_t cio; - - if (!cookie) -@@ -42,8 +46,6 @@ static FILE *cookieopen(void *cookie, const char *mode, - cio.write = cwrite; - cio.close = cclose; - return fopencookie(cookie, *mode == 'w' ? "w" : "r", cio); --#else --# error Need to implement custom I/O - #endif - } - -diff --git a/ext/solv_xfopen_fallback_fopencookie.c b/ext/solv_xfopen_fallback_fopencookie.c -new file mode 100644 -index 0000000..0ce2571 ---- /dev/null -+++ b/ext/solv_xfopen_fallback_fopencookie.c -@@ -0,0 +1,123 @@ -+/* -+ * Provides a very limited fopencookie() for environments with a libc -+ * that lacks it. -+ * -+ * Author: zhasha -+ * Modified for libsolv by Neal Gompa -+ * -+ * This program is licensed under the BSD license, read LICENSE.BSD -+ * for further information. -+ * -+ */ -+ -+#define _LARGEFILE64_SOURCE 1 -+#include <pthread.h> -+#include <stdio.h> -+#include <stdlib.h> -+#include <unistd.h> -+#include <fcntl.h> -+#include <sys/types.h> -+#include <errno.h> -+#include "solv_xfopen_fallback_fopencookie.h" -+ -+extern int pipe2(int[2], int); -+ -+struct ctx { -+ int fd; -+ void *cookie; -+ struct cookie_io_functions_t io; -+ char buf[1024]; -+}; -+ -+static void *proxy(void *arg) -+{ -+ struct ctx *ctx = arg; -+ ssize_t r; -+ size_t n; -+ -+ pthread_detach(pthread_self()); -+ -+ while (1) { -+ r = ctx->io.read ? -+ (ctx->io.read)(ctx->cookie, ctx->buf, sizeof(ctx->buf)) : -+ read(ctx->fd, ctx->buf, sizeof(ctx->buf)); -+ if (r < 0) { -+ if (errno != EINTR) { break; } -+ continue; -+ } -+ if (r == 0) { break; } -+ -+ while (n > 0) { -+ r = ctx->io.write ? -+ (ctx->io.write)(ctx->cookie, ctx->buf + ((size_t)r - n), n) : -+ write(ctx->fd, ctx->buf + ((size_t)r - n), n); -+ if (r < 0) { -+ if (errno != EINTR) { break; } -+ continue; -+ } -+ if (r == 0) { break; } -+ -+ n -= (size_t)r; -+ } -+ if (n > 0) { break; } -+ } -+ -+ if (ctx->io.close) { (ctx->io.close)(ctx->cookie); } -+ close(ctx->fd); -+ return NULL; -+} -+ -+FILE *fopencookie(void *cookie, const char *mode, struct cookie_io_functions_t io) -+{ -+ struct ctx *ctx = NULL; -+ int rd = 0, wr = 0; -+ int p[2] = { -1, -1 }; -+ FILE *f = NULL; -+ pthread_t dummy; -+ -+ switch (mode[0]) { -+ case 'a': -+ case 'r': rd = 1; break; -+ case 'w': wr = 1; break; -+ default: -+ errno = EINVAL; -+ return NULL; -+ } -+ switch (mode[1]) { -+ case '\0': break; -+ case '+': -+ if (mode[2] == '\0') { -+ errno = ENOTSUP; -+ return NULL; -+ } -+ default: -+ errno = EINVAL; -+ return NULL; -+ } -+ if (io.seek) { -+ errno = ENOTSUP; -+ return NULL; -+ } -+ -+ ctx = malloc(sizeof(*ctx)); -+ if (!ctx) { return NULL; } -+ if (pipe2(p, O_CLOEXEC) != 0) { goto err; } -+ if ((f = fdopen(p[wr], mode)) == NULL) { goto err; } -+ p[wr] = -1; -+ ctx->fd = p[rd]; -+ ctx->cookie = cookie; -+ ctx->io.read = rd ? io.read : NULL; -+ ctx->io.write = wr ? io.write : NULL; -+ ctx->io.seek = NULL; -+ ctx->io.close = io.close; -+ if (pthread_create(&dummy, NULL, proxy, ctx) != 0) { goto err; } -+ -+ return f; -+ -+err: -+ if (p[0] >= 0) { close(p[0]); } -+ if (p[1] >= 0) { close(p[1]); } -+ if (f) { fclose(f); } -+ free(ctx); -+ return NULL; -+} -diff --git a/ext/solv_xfopen_fallback_fopencookie.h b/ext/solv_xfopen_fallback_fopencookie.h -new file mode 100644 -index 0000000..6a7bfee ---- /dev/null -+++ b/ext/solv_xfopen_fallback_fopencookie.h -@@ -0,0 +1,28 @@ -+/* -+ * Provides a very limited fopencookie() for environments with a libc -+ * that lacks it. -+ * -+ * Author: zhasha -+ * Modified for libsolv by Neal Gompa -+ * -+ * This program is licensed under the BSD license, read LICENSE.BSD -+ * for further information. -+ * -+ */ -+ -+#ifndef SOLV_XFOPEN_FALLBACK_FOPENCOOKIE_H -+#define SOLV_XFOPEN_FALLBACK_FOPENCOOKIE_H -+ -+#include <stdio.h> -+#include <stdint.h> -+ -+typedef struct cookie_io_functions_t { -+ ssize_t (*read)(void *, char *, size_t); -+ ssize_t (*write)(void *, const char *, size_t); -+ int (*seek)(void *, off64_t, int); -+ int (*close)(void *); -+} cookie_io_functions_t; -+ -+FILE *fopencookie(void *cookie, const char *mode, struct cookie_io_functions_t io); -+ -+#endif --- -2.4.0 - diff --git a/poky/meta/recipes-extended/libsolv/libsolv/0001-build-use-GNUInstallDirs.patch b/poky/meta/recipes-extended/libsolv/libsolv/0001-build-use-GNUInstallDirs.patch new file mode 100644 index 000000000..75ef15005 --- /dev/null +++ b/poky/meta/recipes-extended/libsolv/libsolv/0001-build-use-GNUInstallDirs.patch @@ -0,0 +1,188 @@ +Backport a patch from upstream to use GNUInstallDirs instead of +hand-coded path logic, so we have proper control over where files end up. + +Upstream-Status: Backport +Signed-off-by: Ross Burton <ross.burton@intel.com> + +From b6c9df4c686975ce5009d09dac706a4e83f02a31 Mon Sep 17 00:00:00 2001 +From: Igor Gnatenko <i.gnatenko.brain@gmail.com> +Date: Mon, 2 Jul 2018 12:56:41 +0100 +Subject: [PATCH] build: use GNUInstallDirs + +Fixes: #128 +Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com> +--- + CMakeLists.txt | 34 +++++++--------------------------- + README | 2 +- + doc/CMakeLists.txt | 4 ++-- + examples/solv/CMakeLists.txt | 2 +- + ext/CMakeLists.txt | 8 ++++---- + libsolv.pc.in | 4 ++-- + libsolvext.pc.in | 4 ++-- + src/CMakeLists.txt | 8 ++++---- + tools/CMakeLists.txt | 3 +-- + 9 files changed, 24 insertions(+), 45 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1deef57d..7e9ffa9b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,6 +1,6 @@ + PROJECT (libsolv) + +-CMAKE_MINIMUM_REQUIRED (VERSION 2.4) ++CMAKE_MINIMUM_REQUIRED (VERSION 2.8.5) + + OPTION (ENABLE_STATIC "Build a static version of the libraries?" OFF) + OPTION (DISABLE_SHARED "Do not build a shared version of the libraries?" OFF) +@@ -38,34 +38,14 @@ OPTION (ENABLE_ZCHUNK_COMPRESSION "Build with zchunk compression support?" OFF) + OPTION (WITH_SYSTEM_ZCHUNK "Use system zchunk library?" OFF) + OPTION (WITH_LIBXML2 "Build with libxml2 instead of libexpat?" OFF) + +-# Library +-IF (DEFINED LIB) +- SET (LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${LIB}") +-ELSE (DEFINED LIB) +- IF (CMAKE_SIZEOF_VOID_P MATCHES "8") +- SET (LIB_SUFFIX "64") +- ENDIF (CMAKE_SIZEOF_VOID_P MATCHES "8") +- SET (LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}") +-ENDIF (DEFINED LIB) +-MESSAGE (STATUS "Libraries will be installed in ${LIB_INSTALL_DIR}") +-# Library +-IF (DEFINED INCLUDE) +- SET (INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${INCLUDE}") +-else (DEFINED INCLUDE) +- SET (INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include") +-ENDIF (DEFINED INCLUDE) +-MESSAGE (STATUS "Header files will be installed in ${INCLUDE_INSTALL_DIR}") +-SET (BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin") +-IF (NOT MAN_INSTALL_DIR) +-SET (MAN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/man") +-IF (IS_DIRECTORY "${CMAKE_INSTALL_PREFIX}/man" AND NOT IS_DIRECTORY "${CMAKE_INSTALL_PREFIX}/share/man") +- SET (MAN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/man") +-ENDIF (IS_DIRECTORY "${CMAKE_INSTALL_PREFIX}/man" AND NOT IS_DIRECTORY "${CMAKE_INSTALL_PREFIX}/share/man") +-ENDIF (NOT MAN_INSTALL_DIR) +-MESSAGE(STATUS "Man pages will be installed in ${MAN_INSTALL_DIR}") ++include (GNUInstallDirs) ++message (STATUS "Libraries will be installed in ${CMAKE_INSTALL_FULL_LIBDIR}") ++message (STATUS "Header files will be installed in ${CMAKE_INSTALL_FULL_INCLUDEDIR}") ++message (STATUS "Binaries will be installed in ${CMAKE_INSTALL_FULL_BINDIR}") ++message (STATUS "Man pages will be installed in ${CMAKE_INSTALL_FULL_MANDIR}") + + IF (NOT PKGCONFIG_INSTALL_DIR) +- SET (PKGCONFIG_INSTALL_DIR ${LIB_INSTALL_DIR}/pkgconfig) ++ SET (PKGCONFIG_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/pkgconfig) + ENDIF (NOT PKGCONFIG_INSTALL_DIR) + #################################################################### + # CONFIGURATION # +diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt +index 66011b48..ed38274e 100644 +--- a/doc/CMakeLists.txt ++++ b/doc/CMakeLists.txt +@@ -48,8 +48,8 @@ STRING(REGEX REPLACE "([^;]+)" "gen/\\1" libsolv_MANPAGES3 "${libsolv_MANPAGES3} + + INSTALL(FILES + ${libsolv_MANPAGES3} +- DESTINATION "${MAN_INSTALL_DIR}/man3") ++ DESTINATION "${CMAKE_INSTALL_MANDIR}/man3") + + INSTALL(FILES + ${libsolv_MANPAGES1} +- DESTINATION "${MAN_INSTALL_DIR}/man1") ++ DESTINATION "${CMAKE_INSTALL_MANDIR}/man1") +diff --git a/examples/solv/CMakeLists.txt b/examples/solv/CMakeLists.txt +index 41f45f74..0f3bd477 100644 +--- a/examples/solv/CMakeLists.txt ++++ b/examples/solv/CMakeLists.txt +@@ -25,5 +25,5 @@ TARGET_LINK_LIBRARIES (solv libsolvext libsolv ${SYSTEM_LIBRARIES}) + + INSTALL(TARGETS + solv +- DESTINATION ${BIN_INSTALL_DIR}) ++ DESTINATION ${CMAKE_INSTALL_BINDIR}) + +diff --git a/ext/CMakeLists.txt b/ext/CMakeLists.txt +index edc2b9f9..6dd28b1a 100644 +--- a/ext/CMakeLists.txt ++++ b/ext/CMakeLists.txt +@@ -145,14 +145,14 @@ ENDIF (DISABLE_SHARED) + + SET_TARGET_PROPERTIES(libsolvext PROPERTIES OUTPUT_NAME "solvext") + SET_TARGET_PROPERTIES(libsolvext PROPERTIES SOVERSION ${LIBSOLVEXT_SOVERSION}) +-SET_TARGET_PROPERTIES(libsolvext PROPERTIES INSTALL_NAME_DIR ${LIB_INSTALL_DIR}) ++SET_TARGET_PROPERTIES(libsolvext PROPERTIES INSTALL_NAME_DIR ${CMAKE_INSTALL_LIBDIR}) + +-INSTALL (FILES ${libsolvext_HEADERS} DESTINATION "${INCLUDE_INSTALL_DIR}/solv") +-INSTALL (TARGETS libsolvext LIBRARY DESTINATION ${LIB_INSTALL_DIR} ARCHIVE DESTINATION ${LIB_INSTALL_DIR} RUNTIME DESTINATION bin) ++INSTALL (FILES ${libsolvext_HEADERS} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/solv") ++INSTALL (TARGETS libsolvext LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + + IF (ENABLE_STATIC AND NOT DISABLE_SHARED) + ADD_LIBRARY (libsolvext_static STATIC ${libsolvext_SRCS}) + SET_TARGET_PROPERTIES(libsolvext_static PROPERTIES OUTPUT_NAME "solvext") + SET_TARGET_PROPERTIES(libsolvext_static PROPERTIES SOVERSION ${LIBSOLVEXT_SOVERSION}) +-INSTALL (TARGETS libsolvext_static LIBRARY DESTINATION ${LIB_INSTALL_DIR} ARCHIVE DESTINATION ${LIB_INSTALL_DIR}) ++INSTALL (TARGETS libsolvext_static LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + ENDIF (ENABLE_STATIC AND NOT DISABLE_SHARED) +diff --git a/libsolv.pc.in b/libsolv.pc.in +index 40a86230..766146c5 100644 +--- a/libsolv.pc.in ++++ b/libsolv.pc.in +@@ -1,5 +1,5 @@ +-libdir=@LIB_INSTALL_DIR@ +-includedir=@INCLUDE_INSTALL_DIR@ ++libdir=@CMAKE_INSTALL_FULL_LIBDIR@ ++includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ + + Name: libsolv + Description: Library for solving packages +diff --git a/libsolvext.pc.in b/libsolvext.pc.in +index d48b6fab..d0078461 100644 +--- a/libsolvext.pc.in ++++ b/libsolvext.pc.in +@@ -1,5 +1,5 @@ +-libdir=@LIB_INSTALL_DIR@ +-includedir=@INCLUDE_INSTALL_DIR@ ++libdir=@CMAKE_INSTALL_FULL_LIBDIR@ ++includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ + + Name: libsolvext + Description: Library for reading repositories +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 2e32968e..03ea9119 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -42,14 +42,14 @@ ENDIF (DISABLE_SHARED) + + SET_TARGET_PROPERTIES(libsolv PROPERTIES OUTPUT_NAME "solv") + SET_TARGET_PROPERTIES(libsolv PROPERTIES SOVERSION ${LIBSOLV_SOVERSION}) +-SET_TARGET_PROPERTIES(libsolv PROPERTIES INSTALL_NAME_DIR ${LIB_INSTALL_DIR}) ++SET_TARGET_PROPERTIES(libsolv PROPERTIES INSTALL_NAME_DIR ${CMAKE_INSTALL_LIBDIR}) + +-INSTALL (FILES ${libsolv_HEADERS} DESTINATION "${INCLUDE_INSTALL_DIR}/solv") +-INSTALL (TARGETS libsolv LIBRARY DESTINATION ${LIB_INSTALL_DIR} ARCHIVE DESTINATION ${LIB_INSTALL_DIR} RUNTIME DESTINATION bin) ++INSTALL (FILES ${libsolv_HEADERS} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/solv") ++INSTALL (TARGETS libsolv LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + + IF (ENABLE_STATIC AND NOT DISABLE_SHARED) + ADD_LIBRARY (libsolv_static STATIC ${libsolv_SRCS}) + SET_TARGET_PROPERTIES(libsolv_static PROPERTIES OUTPUT_NAME "solv") + SET_TARGET_PROPERTIES(libsolv_static PROPERTIES SOVERSION ${LIBSOLV_SOVERSION}) +-INSTALL (TARGETS libsolv_static LIBRARY DESTINATION ${LIB_INSTALL_DIR} ARCHIVE DESTINATION ${LIB_INSTALL_DIR}) ++INSTALL (TARGETS libsolv_static LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + ENDIF (ENABLE_STATIC AND NOT DISABLE_SHARED) +diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt +index 802dc500..0d677f69 100644 +--- a/tools/CMakeLists.txt ++++ b/tools/CMakeLists.txt +@@ -110,5 +110,4 @@ TARGET_LINK_LIBRARIES (testsolv libsolvext libsolv ${SYSTEM_LIBRARIES}) + ADD_EXECUTABLE (repo2solv repo2solv.c ) + TARGET_LINK_LIBRARIES (repo2solv toolstuff libsolvext libsolv ${SYSTEM_LIBRARIES}) + +-INSTALL (TARGETS ${tools_list} DESTINATION ${BIN_INSTALL_DIR}) +- ++INSTALL (TARGETS ${tools_list} DESTINATION ${CMAKE_INSTALL_BINDIR}) +-- +2.11.0 + diff --git a/poky/meta/recipes-extended/libsolv/libsolv/0001-solver_solve-only-disfavor-recommends-if-there-are-a.patch b/poky/meta/recipes-extended/libsolv/libsolv/0001-solver_solve-only-disfavor-recommends-if-there-are-a.patch new file mode 100644 index 000000000..139613a0a --- /dev/null +++ b/poky/meta/recipes-extended/libsolv/libsolv/0001-solver_solve-only-disfavor-recommends-if-there-are-a.patch @@ -0,0 +1,33 @@ +From 19d7cc87adba92d31d5fafdf7db00920d24a96a6 Mon Sep 17 00:00:00 2001 +From: Alejandro del Castillo <alejandro.delcastillo@ni.com> +Date: Wed, 6 Feb 2019 13:24:04 -0600 +Subject: [PATCH] solver_solve: only disfavor recommends if there are any + +In a repo that have pkg 'a' and 'b' available, and 'b' is disfavored, +but 'a' doesn't recommend 'b', libsolv segfaults on +solver_addrecommendsrules, since solv->recommendsruleq is null. Only +call solver_addrecommendsrules if there are recommends rules. + +Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com> + +Upstream-Status: Accepted +--- + src/solver.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/solver.c b/src/solver.c +index a80090d19..ad78327a8 100644 +--- a/src/solver.c ++++ b/src/solver.c +@@ -3920,7 +3920,7 @@ solver_solve(Solver *solv, Queue *job) + else + solv->yumobsrules = solv->yumobsrules_end = solv->nrules; + +- if (solv->havedisfavored && solv->strongrecommends) ++ if (solv->havedisfavored && solv->strongrecommends && solv->recommendsruleq) + solver_addrecommendsrules(solv); + else + solv->recommendsrules = solv->recommendsrules_end = solv->nrules; +-- +2.20.1 + diff --git a/poky/meta/recipes-extended/libsolv/libsolv/0002-Fixes-to-internal-fopencookie-implementation.patch b/poky/meta/recipes-extended/libsolv/libsolv/0002-Fixes-to-internal-fopencookie-implementation.patch deleted file mode 100644 index 93b8cc9c1..000000000 --- a/poky/meta/recipes-extended/libsolv/libsolv/0002-Fixes-to-internal-fopencookie-implementation.patch +++ /dev/null @@ -1,105 +0,0 @@ -From 84e12bf7ece49073c559dfd58005132a6099a964 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Neal=20Gompa=20=28=E3=83=8B=E3=83=BC=E3=83=AB=E3=83=BB?= - =?UTF-8?q?=E3=82=B3=E3=82=99=E3=83=B3=E3=83=8F=E3=82=9A=29?= - <ngompa13@gmail.com> -Date: Mon, 23 Nov 2015 18:19:41 -0500 -Subject: [PATCH 2/2] Fixes to internal fopencookie() implementation - -Credits to the fixes go to nsz on #musl on Freenode, -who gloriously fixed the implementation such that -the tests all pass. - -Upstream-Status: Denied [https://github.com/openSUSE/libsolv/pull/112] -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> - ---- - ext/solv_xfopen_fallback_fopencookie.c | 19 ++++++++++--------- - ext/solv_xfopen_fallback_fopencookie.h | 10 +++++----- - 2 files changed, 15 insertions(+), 14 deletions(-) - -diff --git a/ext/solv_xfopen_fallback_fopencookie.c b/ext/solv_xfopen_fallback_fopencookie.c -index 0ce2571..89426a9 100644 ---- a/ext/solv_xfopen_fallback_fopencookie.c -+++ b/ext/solv_xfopen_fallback_fopencookie.c -@@ -1,10 +1,10 @@ --/* -+/* - * Provides a very limited fopencookie() for environments with a libc - * that lacks it. -- * -- * Author: zhasha -+ * -+ * Authors: zhasha & nsz - * Modified for libsolv by Neal Gompa -- * -+ * - * This program is licensed under the BSD license, read LICENSE.BSD - * for further information. - * -@@ -33,7 +33,7 @@ static void *proxy(void *arg) - { - struct ctx *ctx = arg; - ssize_t r; -- size_t n; -+ size_t n, k; - - pthread_detach(pthread_self()); - -@@ -47,17 +47,18 @@ static void *proxy(void *arg) - } - if (r == 0) { break; } - -+ n = r, k = 0; - while (n > 0) { - r = ctx->io.write ? -- (ctx->io.write)(ctx->cookie, ctx->buf + ((size_t)r - n), n) : -- write(ctx->fd, ctx->buf + ((size_t)r - n), n); -+ (ctx->io.write)(ctx->cookie, ctx->buf + k, n) : -+ write(ctx->fd, ctx->buf + k, n); - if (r < 0) { - if (errno != EINTR) { break; } - continue; - } - if (r == 0) { break; } - -- n -= (size_t)r; -+ n -= r, k += r; - } - if (n > 0) { break; } - } -@@ -77,8 +78,8 @@ FILE *fopencookie(void *cookie, const char *mode, struct cookie_io_functions_t i - - switch (mode[0]) { - case 'a': -- case 'r': rd = 1; break; - case 'w': wr = 1; break; -+ case 'r': rd = 1; break; - default: - errno = EINVAL; - return NULL; -diff --git a/ext/solv_xfopen_fallback_fopencookie.h b/ext/solv_xfopen_fallback_fopencookie.h -index 6a7bfee..7223e3f 100644 ---- a/ext/solv_xfopen_fallback_fopencookie.h -+++ b/ext/solv_xfopen_fallback_fopencookie.h -@@ -1,13 +1,13 @@ --/* -+/* - * Provides a very limited fopencookie() for environments with a libc - * that lacks it. -- * -- * Author: zhasha -+ * -+ * Authors: zhasha & nsz - * Modified for libsolv by Neal Gompa -- * -+ * - * This program is licensed under the BSD license, read LICENSE.BSD - * for further information. -- * -+ * - */ - - #ifndef SOLV_XFOPEN_FALLBACK_FOPENCOOKIE_H --- -2.4.0 - diff --git a/poky/meta/recipes-extended/libsolv/libsolv_0.6.35.bb b/poky/meta/recipes-extended/libsolv/libsolv_0.7.3.bb index 12dfc5d3a..70c8dbc2e 100644 --- a/poky/meta/recipes-extended/libsolv/libsolv_0.6.35.bb +++ b/poky/meta/recipes-extended/libsolv/libsolv_0.7.3.bb @@ -7,12 +7,12 @@ LIC_FILES_CHKSUM = "file://LICENSE.BSD;md5=62272bd11c97396d4aaf1c41bc11f7d8" DEPENDS = "expat zlib" -SRC_URI = "git://github.com/openSUSE/libsolv.git" -SRC_URI_append_libc-musl = " file://0001-Add-fallback-fopencookie-implementation.patch \ - file://0002-Fixes-to-internal-fopencookie-implementation.patch \ - " +SRC_URI = "git://github.com/openSUSE/libsolv.git \ + file://0001-solver_solve-only-disfavor-recommends-if-there-are-a.patch \ + file://0001-build-use-GNUInstallDirs.patch \ +" -SRCREV = "38c5374d4712667b0b6ada4bf78ddbb343095d0c" +SRCREV = "dc7d0f1c3113f2c8217563166906bef3eb5d1ee1" UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+)" S = "${WORKDIR}/git" @@ -22,7 +22,7 @@ inherit cmake PACKAGECONFIG ??= "rpm" PACKAGECONFIG[rpm] = "-DENABLE_RPMMD=ON -DENABLE_RPMDB=ON,,rpm" -EXTRA_OECMAKE = "-DLIB=${baselib} -DMULTI_SEMANTICS=ON -DENABLE_COMPLEX_DEPS=ON" +EXTRA_OECMAKE = "-DMULTI_SEMANTICS=ON -DENABLE_COMPLEX_DEPS=ON" PACKAGES =+ "${PN}-tools ${PN}ext" |