From 275241ea681a8a6019b89c41ec39d65c45b851f3 Mon Sep 17 00:00:00 2001 From: Mark Hatle Date: Wed, 16 Mar 2011 17:15:09 -0500 Subject: sat-solver: Fix solution DB generation and general cleanup Uprev sat-solver to the latest git version. This corrects the solv db generation with RPM5. Refactor the patches for RPM5 support, cleaning up components of the cmake.patch for submission upstream. (Also fix a problem remaining in the upstream with a mismatched function name.) (From OE-Core rev: 89a5ad96eef411dccea817a6c37cb1e24840fdc1) Signed-off-by: Mark Hatle Signed-off-by: Richard Purdie --- .../sat-solver/sat-solver/cmake.patch | 58 +++---------------- .../sat-solver/sat-solver/rpm5-solvdb.patch | 30 ---------- .../sat-solver/sat-solver/rpm5.patch | 53 ----------------- .../sat-solver/sat-solver/sat-solver_rpm5.patch | 67 ++++++++++++++++++++++ meta/recipes-extended/sat-solver/sat-solver_git.bb | 7 +-- 5 files changed, 77 insertions(+), 138 deletions(-) delete mode 100644 meta/recipes-extended/sat-solver/sat-solver/rpm5-solvdb.patch delete mode 100644 meta/recipes-extended/sat-solver/sat-solver/rpm5.patch create mode 100644 meta/recipes-extended/sat-solver/sat-solver/sat-solver_rpm5.patch (limited to 'meta/recipes-extended/sat-solver') diff --git a/meta/recipes-extended/sat-solver/sat-solver/cmake.patch b/meta/recipes-extended/sat-solver/sat-solver/cmake.patch index 854bd40d75..52319f0e4f 100644 --- a/meta/recipes-extended/sat-solver/sat-solver/cmake.patch +++ b/meta/recipes-extended/sat-solver/sat-solver/cmake.patch @@ -1,59 +1,15 @@ -check rpm +Enable debugging for all builds not building docs (need oxygen) 8/19/2010 - created by Qing He 1/24/2011 - Disable Fedora/Debian checking/settings by Mark Hatle 3/15/2011 - Updated to newer version of sat-solver by Mark Hatle +3/16/2011 - Split original patch and simplify by Mark Hatle -diff -ur git.orig/CMakeLists.txt git/CMakeLists.txt ---- git.orig/CMakeLists.txt 2011-03-15 17:14:22.000000000 -0500 -+++ git/CMakeLists.txt 2011-03-15 17:20:09.648880770 -0500 -@@ -35,22 +35,15 @@ - FIND_PACKAGE(Check REQUIRED) - FIND_PACKAGE(ZLIB REQUIRED) - --IF ( FEDORA ) --MESSAGE(STATUS "Building for Fedora") --ADD_DEFINITIONS( -DFEDORA ) --ENDIF ( FEDORA) -- --IF ( DEBIAN ) --MESSAGE(STATUS "Building for Debian") --ADD_DEFINITIONS( -DDEBIAN -DDEBIAN_SEMANTICS) --ENDIF ( DEBIAN ) -- - IF ( MULTI_SEMANTICS ) - MESSAGE(STATUS "Enabling multi dist support") - ADD_DEFINITIONS( -DMULTI_SEMANTICS) - ENDIF ( MULTI_SEMANTICS ) - --IF ( NOT DEBIAN ) -+FIND_PACKAGE(PkgConfig REQUIRED) -+PKG_CHECK_MODULES(RPM REQUIRED rpm) -+INCLUDE_DIRECTORIES( ${RPM_INCLUDE_DIRS} ) -+ - FIND_LIBRARY(RPMDB_LIBRARY NAMES rpmdb) - IF ( NOT RPMDB_LIBRARY ) - FIND_LIBRARY(RPMDB_LIBRARY NAMES rpm) -@@ -59,13 +52,14 @@ - IF ( RPMIO_LIBRARY ) - SET( RPMDB_LIBRARY ${RPMIO_LIBRARY} ${RPMDB_LIBRARY} ) - ENDIF ( RPMIO_LIBRARY ) --IF ( FEDORA ) -+FIND_LIBRARY(RPMMISC_LIBRARY NAMES rpmmisc) -+IF ( RPMMISC_LIBRARY ) -+SET( RPMDB_LIBRARY ${RPMMISC_LIBRARY} ${RPMDB_LIBRARY} ) -+ENDIF ( RPMMISC_LIBRARY ) - FIND_LIBRARY(DB_LIBRARY NAMES db) - IF ( DB_LIBRARY ) - SET( RPMDB_LIBRARY ${DB_LIBRARY} ${RPMDB_LIBRARY} ) - ENDIF ( DB_LIBRARY ) --ENDIF ( FEDORA ) --ENDIF ( NOT DEBIAN ) - - INCLUDE ( CheckFunctionExists ) - INCLUDE ( TestBigEndian ) -@@ -164,7 +158,7 @@ +diff -ur git.orig2/CMakeLists.txt git/CMakeLists.txt +--- git.orig2/CMakeLists.txt 2011-03-16 16:29:43.532032285 -0500 ++++ git/CMakeLists.txt 2011-03-16 16:32:59.982034501 -0500 +@@ -177,7 +177,7 @@ MESSAGE(STATUS "Looking modules in ${CMAKE_MODULE_PATH}") @@ -62,7 +18,7 @@ diff -ur git.orig/CMakeLists.txt git/CMakeLists.txt set ( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -g -O3" ) set ( CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g3 -O0" ) -@@ -173,7 +167,7 @@ +@@ -186,7 +186,7 @@ ADD_SUBDIRECTORY(tools) ADD_SUBDIRECTORY(tests) ADD_SUBDIRECTORY(examples) diff --git a/meta/recipes-extended/sat-solver/sat-solver/rpm5-solvdb.patch b/meta/recipes-extended/sat-solver/sat-solver/rpm5-solvdb.patch deleted file mode 100644 index 8ce1b150c5..0000000000 --- a/meta/recipes-extended/sat-solver/sat-solver/rpm5-solvdb.patch +++ /dev/null @@ -1,30 +0,0 @@ -sat-solver rpmdb based solv database construction - -The first time the database is created on an RPM5 system it works -correctly. However any subsequent rebuilds cause an empty database to -occur. - -The following is from Michael Schroeder : -> rpmdb2solv contains a hack that makes it use the unchanged already -> converted packages. To do this, it needs to get the database id -> for every installed packages by reading the "Name" index. This -> somehow doesn't seem to work with rpm5. -> -> As a workaround you can add a "ref = 0;" line at the top of the -> repo_add_rpmdb() function in ext/repo_rpmdb.c. - -Signed-off-by: Mark Hatle - -diff -ur git.orig/ext/repo_rpmdb.c git/ext/repo_rpmdb.c ---- git.orig/ext/repo_rpmdb.c 2011-03-16 09:43:50.470008215 -0500 -+++ git/ext/repo_rpmdb.c 2011-03-16 09:47:55.503989694 -0500 -@@ -1344,6 +1344,9 @@ - memset(&dbkey, 0, sizeof(dbkey)); - memset(&dbdata, 0, sizeof(dbdata)); - -+ /* Workaround for RPM 5 database construction */ -+ ref = 0; -+ - if (!rootdir) - rootdir = ""; - diff --git a/meta/recipes-extended/sat-solver/sat-solver/rpm5.patch b/meta/recipes-extended/sat-solver/sat-solver/rpm5.patch deleted file mode 100644 index 5ab632155d..0000000000 --- a/meta/recipes-extended/sat-solver/sat-solver/rpm5.patch +++ /dev/null @@ -1,53 +0,0 @@ -fix rpm5 build - -8/19/2010 - created by Qing He - - -pgpDigNew/pgpDigFree has changed in RPM 5.4.0 - -Signed-off-by: Qing He - -diff --git a/ext/repo_rpmdb.c b/ext/repo_rpmdb.c -index 34f2b65..3c6ab9a 100644 ---- a/ext/repo_rpmdb.c -+++ b/ext/repo_rpmdb.c -@@ -21,10 +21,11 @@ - #include - #include - #include -+#include - - #include - #include --#include -+//#include - #include - - #ifndef DB_CREATE -@@ -2466,7 +2467,7 @@ rpm_byrpmh(Header h, void **statep) - int sigdsize, sigcnt, l; - RpmHead *rpmhead; - -- uh = headerUnload(h); -+ uh = headerUnload(h, NULL); - if (!uh) - return 0; - sigcnt = getu32(uh); -@@ -2982,7 +2983,7 @@ pubkey2solvable(Solvable *s, Repodata *data, char *pubkey) - parsekeydata(s, data, pkts, pktsl); - /* only rpm knows how to do the release calculation, we don't dare - * to recreate all the bugs */ -- dig = pgpNewDig(); -+ dig = pgpDigNew(RPMVSF_DEFAULT, 0); - (void) pgpPrtPkts(pkts, pktsl, dig, 0); - btime = dig->pubkey.time[0] << 24 | dig->pubkey.time[1] << 16 | dig->pubkey.time[2] << 8 | dig->pubkey.signid[3]; - sprintf(evrbuf, "%02x%02x%02x%02x-%02x%02x%02x%02x", dig->pubkey.signid[4], dig->pubkey.signid[5], dig->pubkey.signid[6], dig->pubkey.signid[7], dig->pubkey.time[0], dig->pubkey.time[1], dig->pubkey.time[2], dig->pubkey.time[3]); -@@ -2996,7 +2997,7 @@ pubkey2solvable(Solvable *s, Repodata *data, char *pubkey) - repodata_set_str(data, s - s->repo->pool->solvables, PUBKEY_KEYID, keyid); - if (dig->pubkey.userid) - setutf8string(data, s - s->repo->pool->solvables, SOLVABLE_SUMMARY, dig->pubkey.userid); -- pgpFreeDig(dig); -+ (void) pgpDigFree(dig); - sat_free((void *)pkts); - return 1; - } diff --git a/meta/recipes-extended/sat-solver/sat-solver/sat-solver_rpm5.patch b/meta/recipes-extended/sat-solver/sat-solver/sat-solver_rpm5.patch new file mode 100644 index 0000000000..1776f6cd59 --- /dev/null +++ b/meta/recipes-extended/sat-solver/sat-solver/sat-solver_rpm5.patch @@ -0,0 +1,67 @@ +Add RPM5 configuration support + +Update the cmake configuration to detect additional files needed by RPM5. + +Original work by Qing He . + +Merged and updated to make this more likely to be accepted upstream. + +Signed-off-by: Mark Hatle + +diff -ur git.orig/CMakeLists.txt git/CMakeLists.txt +--- git.orig/CMakeLists.txt 2011-03-16 16:16:29.152786178 -0500 ++++ git/CMakeLists.txt 2011-03-16 16:29:43.532032285 -0500 +@@ -50,7 +50,16 @@ + ADD_DEFINITIONS( -DMULTI_SEMANTICS) + ENDIF ( MULTI_SEMANTICS ) + +-IF ( NOT DEBIAN ) ++if ( RPM5 ) ++MESSAGE(STATUS "Enabling RPM 5 support") ++ADD_DEFINITIONS( -DRPM5) ++ ++FIND_PACKAGE(PkgConfig REQUIRED) ++PKG_CHECK_MODULES(RPM REQUIRED rpm) ++INCLUDE_DIRECTORIES( ${RPM_INCLUDE_DIRS} ) ++ENDIF ( RPM5 ) ++ ++IF ( RPM5 OR NOT DEBIAN ) + FIND_LIBRARY(RPMDB_LIBRARY NAMES rpmdb) + IF ( NOT RPMDB_LIBRARY ) + FIND_LIBRARY(RPMDB_LIBRARY NAMES rpm) +@@ -59,13 +68,17 @@ + IF ( RPMIO_LIBRARY ) + SET( RPMDB_LIBRARY ${RPMIO_LIBRARY} ${RPMDB_LIBRARY} ) + ENDIF ( RPMIO_LIBRARY ) +-IF ( FEDORA ) ++FIND_LIBRARY(RPMMISC_LIBRARY NAMES rpmmisc) ++IF ( RPMMISC_LIBRARY ) ++SET ( RPMDB_LIBRARY ${RPMMISC_LIBRARY} ${RPMDB_LIBRARY} ) ++ENDIF ( RPMMISC_LIBRARY ) ++IF ( RPM5 OR FEDORA ) + FIND_LIBRARY(DB_LIBRARY NAMES db) + IF ( DB_LIBRARY ) + SET( RPMDB_LIBRARY ${DB_LIBRARY} ${RPMDB_LIBRARY} ) + ENDIF ( DB_LIBRARY ) +-ENDIF ( FEDORA ) +-ENDIF ( NOT DEBIAN ) ++ENDIF ( RPM5 OR FEDORA ) ++ENDIF ( RPM5 OR NOT DEBIAN ) + + INCLUDE ( CheckFunctionExists ) + INCLUDE ( TestBigEndian ) +diff -ur git.orig/ext/repo_rpmdb.c git/ext/repo_rpmdb.c +--- git.orig/ext/repo_rpmdb.c 2011-03-16 18:03:55.401907738 -0500 ++++ git/ext/repo_rpmdb.c 2011-03-16 18:04:47.472989651 -0500 +@@ -3039,7 +3039,11 @@ + repodata_set_str(data, s - s->repo->pool->solvables, PUBKEY_KEYID, keyid); + if (dig->pubkey.userid) + setutf8string(data, s - s->repo->pool->solvables, SOLVABLE_SUMMARY, dig->pubkey.userid); ++#ifndef RPM5 + (void)pgpFreeDig(dig); ++#else ++ (void)pgpDigFree(dig); ++#endif + sat_free((void *)pkts); + return 1; + } diff --git a/meta/recipes-extended/sat-solver/sat-solver_git.bb b/meta/recipes-extended/sat-solver/sat-solver_git.bb index a6519d5921..ba5af67f70 100644 --- a/meta/recipes-extended/sat-solver/sat-solver_git.bb +++ b/meta/recipes-extended/sat-solver/sat-solver_git.bb @@ -7,12 +7,11 @@ LIC_FILES_CHKSUM = "file://LICENSE.BSD;md5=62272bd11c97396d4aaf1c41bc11f7d8" DEPENDS = "libcheck rpm zlib expat db" PV = "0.0-git${SRCPV}" -PR = "r5" +PR = "r6" SRC_URI = "git://gitorious.org/opensuse/sat-solver.git;protocol=git \ + file://sat-solver_rpm5.patch \ file://cmake.patch \ - file://rpm5.patch \ - file://rpm5-solvdb.patch \ file://db5.patch \ file://builtin-arch.patch;apply=no \ file://no-builtin-arch.patch;apply=no \ @@ -20,7 +19,7 @@ SRC_URI = "git://gitorious.org/opensuse/sat-solver.git;protocol=git \ S = "${WORKDIR}/git" -EXTRA_OECMAKE += "-DLIB=lib" +EXTRA_OECMAKE += "-DLIB=lib -DRPM5=RPM5" inherit cmake pkgconfig -- cgit v1.2.3-54-g00ecf