From 10676c6c017e27836eee3c05c91dee6dc232be1b Mon Sep 17 00:00:00 2001 From: Michal Luscon Date: Oct 14 2015 15:12:56 +0000 Subject: Update to 0.6.14 Backport upstream patches --- diff --git a/0001-Move-allowuninstall-map-creation.patch b/0001-Move-allowuninstall-map-creation.patch new file mode 100644 index 0000000..1b1d37f --- /dev/null +++ b/0001-Move-allowuninstall-map-creation.patch @@ -0,0 +1,64 @@ +From 80ddee19786b7b96d28cde1b972721dc631ee055 Mon Sep 17 00:00:00 2001 +From: Michael Schroeder +Date: Mon, 12 Oct 2015 13:43:05 +0200 +Subject: [PATCH 1/4] Move allowuninstall map creation + +We need to test for them when we have dup jobs +--- + src/solver.c | 26 ++++++++++++++------------ + 1 file changed, 14 insertions(+), 12 deletions(-) + +diff --git a/src/solver.c b/src/solver.c +index c6cad6b..f371546 100644 +--- a/src/solver.c ++++ b/src/solver.c +@@ -3561,6 +3561,19 @@ solver_solve(Solver *solv, Queue *job) + MAPSET(&solv->droporphanedmap, p - installed->start); + } + break; ++ case SOLVER_ALLOWUNINSTALL: ++ if (select == SOLVER_SOLVABLE_ALL || (select == SOLVER_SOLVABLE_REPO && installed && what == installed->repoid)) ++ solv->allowuninstall_all = 1; ++ FOR_JOB_SELECT(p, pp, select, what) ++ { ++ s = pool->solvables + p; ++ if (s->repo != installed) ++ continue; ++ if (!solv->allowuninstallmap.size) ++ map_grow(&solv->allowuninstallmap, installed->end - installed->start); ++ MAPSET(&solv->allowuninstallmap, p - installed->start); ++ } ++ break; + default: + break; + } +@@ -3608,7 +3621,7 @@ solver_solve(Solver *solv, Queue *job) + if (how & SOLVER_FORCEBEST) + solv->bestupdatemap_all = 1; + } +- if (!solv->dupmap_all || solv->allowuninstall) ++ if (!solv->dupmap_all || solv->allowuninstall || solv->allowuninstall_all || solv->allowuninstallmap.size) + hasdupjob = 1; + break; + default: +@@ -3917,17 +3930,6 @@ solver_solve(Solver *solv, Queue *job) + break; + case SOLVER_ALLOWUNINSTALL: + POOL_DEBUG(SOLV_DEBUG_JOB, "job: allowuninstall %s\n", solver_select2str(pool, select, what)); +- if (select == SOLVER_SOLVABLE_ALL || (select == SOLVER_SOLVABLE_REPO && installed && what == installed->repoid)) +- solv->allowuninstall_all = 1; +- FOR_JOB_SELECT(p, pp, select, what) +- { +- s = pool->solvables + p; +- if (s->repo != installed) +- continue; +- if (!solv->allowuninstallmap.size) +- map_grow(&solv->allowuninstallmap, installed->end - installed->start); +- MAPSET(&solv->allowuninstallmap, p - installed->start); +- } + break; + default: + POOL_DEBUG(SOLV_DEBUG_JOB, "job: unknown job\n"); +-- +2.6.1 + diff --git a/0001-Simplify-solver_addduprules-a-bit.patch b/0001-Simplify-solver_addduprules-a-bit.patch new file mode 100644 index 0000000..188bfd3 --- /dev/null +++ b/0001-Simplify-solver_addduprules-a-bit.patch @@ -0,0 +1,55 @@ +From 364c90b0d551d1b4b30a4a8de85e7652ff8ac697 Mon Sep 17 00:00:00 2001 +From: Michael Schroeder +Date: Tue, 13 Oct 2015 10:36:58 +0200 +Subject: [PATCH 1/6] Simplify solver_addduprules a bit + +--- + src/rules.c | 13 +++++++------ + 1 file changed, 7 insertions(+), 6 deletions(-) + +diff --git a/src/rules.c b/src/rules.c +index ead78d6..480e052 100644 +--- a/src/rules.c ++++ b/src/rules.c +@@ -1796,6 +1796,7 @@ void + solver_addduprules(Solver *solv, Map *addedmap) + { + Pool *pool = solv->pool; ++ Repo *installed = solv->installed; + Id p, pp; + Solvable *s, *ps; + int first, i; +@@ -1818,11 +1819,11 @@ solver_addduprules(Solver *solv, Map *addedmap) + break; + if (!MAPTST(&solv->dupinvolvedmap, p)) + continue; +- if (solv->installed && ps->repo == solv->installed) ++ if (installed && ps->repo == installed) + { + if (!solv->updatemap.size) +- map_grow(&solv->updatemap, solv->installed->end - solv->installed->start); +- MAPSET(&solv->updatemap, p - solv->installed->start); ++ map_grow(&solv->updatemap, installed->end - installed->start); ++ MAPSET(&solv->updatemap, p - installed->start); + if (!MAPTST(&solv->dupmap, p)) + { + Id ip, ipp; +@@ -1835,12 +1836,12 @@ solver_addduprules(Solver *solv, Map *addedmap) + if (is->evr == ps->evr && solvable_identical(ps, is)) + break; + } +- if (!ip && solv->dupmap_all && solv->keep_orphans) ++ if (!ip && solv->keep_orphans) + { + /* is this an orphan we should keep? */ +- Rule *r = solv->rules + solv->featurerules + (p - solv->installed->start); ++ Rule *r = solv->rules + solv->featurerules + (p - installed->start); + if (!r->p) +- r = solv->rules + solv->updaterules + (p - solv->installed->start); ++ r += solv->updaterules - solv->featurerules; + if (r->p == p && !r->d) + ip = p; + } +-- +2.4.3 + diff --git a/0001-ruby-make-compatible-with-ruby-2.2.patch b/0001-ruby-make-compatible-with-ruby-2.2.patch new file mode 100644 index 0000000..51333aa --- /dev/null +++ b/0001-ruby-make-compatible-with-ruby-2.2.patch @@ -0,0 +1,44 @@ +From d82a26ca0950191546f546264e79ff72e2dbf09f Mon Sep 17 00:00:00 2001 +From: Igor Gnatenko +Date: Mon, 12 Oct 2015 18:52:16 +0200 +Subject: [PATCH] ruby: make compatible with ruby 2.2 + +Signed-off-by: Igor Gnatenko +--- + bindings/ruby/CMakeLists.txt | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/bindings/ruby/CMakeLists.txt b/bindings/ruby/CMakeLists.txt +index 6c3bd50..a7a3394 100644 +--- a/bindings/ruby/CMakeLists.txt ++++ b/bindings/ruby/CMakeLists.txt +@@ -6,8 +6,17 @@ ELSE (USE_VENDORDIRS AND RUBY_VENDORARCH_DIR) + SET (RUBY_INSTALL_DIR ${RUBY_SITEARCH_DIR}) + ENDIF (USE_VENDORDIRS AND RUBY_VENDORARCH_DIR) + ++EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['arch']" ++ OUTPUT_VARIABLE RUBY_ARCH) ++ ++EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['rubyhdrdir']" ++ OUTPUT_VARIABLE RUBY_HDR_DIR) ++ ++SET(RUBY_INCLUDE_DIRS ${RUBY_HDR_DIR} ${RUBY_HDR_DIR}/${RUBY_ARCH}) ++ + MESSAGE (STATUS "Ruby executable: ${RUBY_EXECUTABLE}") + MESSAGE (STATUS "Ruby installation dir: ${RUBY_INSTALL_DIR}") ++MESSAGE (STATUS "Ruby include dir: ${RUBY_INCLUDE_DIRS}") + + ADD_CUSTOM_COMMAND ( + OUTPUT solv_ruby.c +@@ -17,7 +26,7 @@ ADD_CUSTOM_COMMAND ( + ) + + ADD_DEFINITIONS(-Wno-unused) +-INCLUDE_DIRECTORIES (${RUBY_INCLUDE_PATH}) ++INCLUDE_DIRECTORIES (${RUBY_INCLUDE_DIRS}) + + ADD_LIBRARY (bindings_ruby MODULE solv_ruby.c) + SET_TARGET_PROPERTIES (bindings_ruby PROPERTIES PREFIX "" OUTPUT_NAME "solv") +-- +2.6.1 + diff --git a/0002-Drop-inline-from-solver_addtodupmaps.patch b/0002-Drop-inline-from-solver_addtodupmaps.patch new file mode 100644 index 0000000..a8f690d --- /dev/null +++ b/0002-Drop-inline-from-solver_addtodupmaps.patch @@ -0,0 +1,26 @@ +From 03d4ab0de755a1d20443be70f629f9b0eb3616fa Mon Sep 17 00:00:00 2001 +From: Michael Schroeder +Date: Tue, 13 Oct 2015 13:22:14 +0200 +Subject: [PATCH 2/6] Drop inline from solver_addtodupmaps + +The compiler knows best... +--- + src/rules.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/rules.c b/src/rules.c +index 480e052..cb45098 100644 +--- a/src/rules.c ++++ b/src/rules.c +@@ -1623,7 +1623,7 @@ add_cleandeps_package(Solver *solv, Id p) + queue_pushunique(solv->cleandeps_updatepkgs, p); + } + +-static inline void ++static void + solver_addtodupmaps(Solver *solv, Id p, Id how, int targeted) + { + Pool *pool = solv->pool; +-- +2.4.3 + diff --git a/0002-Prefer-to-autouninstall-orphans.patch b/0002-Prefer-to-autouninstall-orphans.patch new file mode 100644 index 0000000..7711663 --- /dev/null +++ b/0002-Prefer-to-autouninstall-orphans.patch @@ -0,0 +1,42 @@ +From 36a4434559e3885f75f3e1e878f11f3b18fce920 Mon Sep 17 00:00:00 2001 +From: Michael Schroeder +Date: Mon, 12 Oct 2015 14:03:25 +0200 +Subject: [PATCH 2/4] Prefer to autouninstall orphans + +--- + src/solver.c | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +diff --git a/src/solver.c b/src/solver.c +index f371546..87b6c45 100644 +--- a/src/solver.c ++++ b/src/solver.c +@@ -217,13 +217,24 @@ autouninstall(Solver *solv, Id *problem) + Rule *r; + if (m && !MAPTST(m, v - solv->updaterules)) + continue; +- /* check if identical to feature rule, we don't like that */ ++ /* check if identical to feature rule, we don't like that (except for orphans) */ + r = solv->rules + solv->featurerules + (v - solv->updaterules); + if (!r->p) + { + /* update rule == feature rule */ + if (v > lastfeature) + lastfeature = v; ++ /* prefer orphaned packages in dup mode */ ++ if (solv->dupmap_all && solv->keep_orphans) ++ { ++ r = solv->rules + v; ++ if (!r->d && r->p == (solv->installed->start + (v - solv->updaterules))) ++ { ++ lastfeature = v; ++ lastupdate = 0; ++ break; ++ } ++ } + continue; + } + if (v > lastupdate) +-- +2.6.1 + diff --git a/0003-Check-keep_orphans-flag-in-solver_addduprules.patch b/0003-Check-keep_orphans-flag-in-solver_addduprules.patch new file mode 100644 index 0000000..6daf307 --- /dev/null +++ b/0003-Check-keep_orphans-flag-in-solver_addduprules.patch @@ -0,0 +1,33 @@ +From d5af25c0ef8fb01e5b0d377a2d7223281991b960 Mon Sep 17 00:00:00 2001 +From: Michael Schroeder +Date: Mon, 12 Oct 2015 14:03:55 +0200 +Subject: [PATCH 3/4] Check keep_orphans flag in solver_addduprules + +solver_addduprules is called if allowuninstall is set +--- + src/rules.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/src/rules.c b/src/rules.c +index b941986..ead78d6 100644 +--- a/src/rules.c ++++ b/src/rules.c +@@ -1835,6 +1835,15 @@ solver_addduprules(Solver *solv, Map *addedmap) + if (is->evr == ps->evr && solvable_identical(ps, is)) + break; + } ++ if (!ip && solv->dupmap_all && solv->keep_orphans) ++ { ++ /* is this an orphan we should keep? */ ++ Rule *r = solv->rules + solv->featurerules + (p - solv->installed->start); ++ if (!r->p) ++ r = solv->rules + solv->updaterules + (p - solv->installed->start); ++ if (r->p == p && !r->d) ++ ip = p; ++ } + if (!ip) + solver_addrule(solv, -p, 0, 0); /* no match, sorry */ + else +-- +2.6.1 + diff --git a/0003-Rename-hasdupjobs-to-needduprules.patch b/0003-Rename-hasdupjobs-to-needduprules.patch new file mode 100644 index 0000000..d2e6510 --- /dev/null +++ b/0003-Rename-hasdupjobs-to-needduprules.patch @@ -0,0 +1,61 @@ +From 8daeacc77ee255e997fe8c9c5ab026435853a0e0 Mon Sep 17 00:00:00 2001 +From: Michael Schroeder +Date: Tue, 13 Oct 2015 13:24:49 +0200 +Subject: [PATCH 3/6] Rename hasdupjobs to needduprules + +--- + src/solver.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/src/solver.c b/src/solver.c +index 87b6c45..c7b21d9 100644 +--- a/src/solver.c ++++ b/src/solver.c +@@ -3361,7 +3361,7 @@ solver_solve(Solver *solv, Queue *job) + Solvable *s; + Rule *r; + int now, solve_start; +- int hasdupjob = 0; ++ int needduprules = 0; + int hasbestinstalljob = 0; + + solve_start = solv_timems(0); +@@ -3633,7 +3633,7 @@ solver_solve(Solver *solv, Queue *job) + solv->bestupdatemap_all = 1; + } + if (!solv->dupmap_all || solv->allowuninstall || solv->allowuninstall_all || solv->allowuninstallmap.size) +- hasdupjob = 1; ++ needduprules = 1; + break; + default: + break; +@@ -3688,7 +3688,7 @@ solver_solve(Solver *solv, Queue *job) + + /* create dup maps if needed. We need the maps early to create our + * update rules */ +- if (hasdupjob) ++ if (needduprules) + solver_createdupmaps(solv); + + /* +@@ -3979,7 +3979,7 @@ solver_solve(Solver *solv, Queue *job) + else + solv->infarchrules = solv->infarchrules_end = solv->nrules; + +- if (hasdupjob) ++ if (needduprules) + solver_addduprules(solv, &addedmap); + else + solv->duprules = solv->duprules_end = solv->nrules; +@@ -3989,7 +3989,7 @@ solver_solve(Solver *solv, Queue *job) + else + solv->bestrules = solv->bestrules_end = solv->nrules; + +- if (hasdupjob) ++ if (needduprules) + solver_freedupmaps(solv); /* no longer needed */ + + if (solv->do_yum_obsoletes) +-- +2.4.3 + diff --git a/0004-Fix-spelling-duh.patch b/0004-Fix-spelling-duh.patch new file mode 100644 index 0000000..745bf06 --- /dev/null +++ b/0004-Fix-spelling-duh.patch @@ -0,0 +1,25 @@ +From 18f93e12d10aa2a507ffa3689725e21a85a81e7f Mon Sep 17 00:00:00 2001 +From: Michael Schroeder +Date: Mon, 12 Oct 2015 14:04:54 +0200 +Subject: [PATCH 4/4] Fix spelling, duh... + +--- + ext/testcase.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ext/testcase.c b/ext/testcase.c +index 3c40451..b9fddef 100644 +--- a/ext/testcase.c ++++ b/ext/testcase.c +@@ -164,7 +164,7 @@ static struct selflags2str { + }; + + static const char *features[] = { +-#ifdef ENABLE_LINKED_PACKAGES ++#ifdef ENABLE_LINKED_PKGS + "linked_packages", + #endif + #ifdef ENABLE_COMPLEX_DEPS +-- +2.6.1 + diff --git a/0004-Fix-typo-in-comment.patch b/0004-Fix-typo-in-comment.patch new file mode 100644 index 0000000..59711fb --- /dev/null +++ b/0004-Fix-typo-in-comment.patch @@ -0,0 +1,25 @@ +From e8ffe5ad6549242908b666f352cf1f59d37c023c Mon Sep 17 00:00:00 2001 +From: Michael Schroeder +Date: Tue, 13 Oct 2015 13:28:56 +0200 +Subject: [PATCH 4/6] Fix typo in comment + +--- + src/linkedpkg.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/linkedpkg.c b/src/linkedpkg.c +index c5adc9a..7575b0d 100644 +--- a/src/linkedpkg.c ++++ b/src/linkedpkg.c +@@ -21,7 +21,7 @@ + * + * product: + * created from product data in the repository (which is generated from files +- * in /etc/products.d. In the future we may switch to using product() ++ * in /etc/products.d). In the future we may switch to using product() + * provides of packages. + * + * pattern: +-- +2.4.3 + diff --git a/0005-Speed-up-choice-rule-generation.patch b/0005-Speed-up-choice-rule-generation.patch new file mode 100644 index 0000000..56cea68 --- /dev/null +++ b/0005-Speed-up-choice-rule-generation.patch @@ -0,0 +1,133 @@ +From ac0801c908fb25c8d9d1384470c26d6ffc991c3d Mon Sep 17 00:00:00 2001 +From: Michael Schroeder +Date: Wed, 14 Oct 2015 11:12:53 +0200 +Subject: [PATCH 5/6] Speed up choice rule generation + +Reduce the amount of package filtering calls. Brings down the choice +rule creation time from 18ms to 8ms on my system. +--- + src/rules.c | 68 ++++++++++++++++++++++++++++++++++++++++--------------------- + 1 file changed, 45 insertions(+), 23 deletions(-) + +diff --git a/src/rules.c b/src/rules.c +index cb45098..97ccc6e 100644 +--- a/src/rules.c ++++ b/src/rules.c +@@ -2833,32 +2833,51 @@ solver_rule2rules(Solver *solv, Id rid, Queue *q, int recursive) + + /* check if the newest versions of pi still provides the dependency we're looking for */ + static int +-solver_choicerulecheck(Solver *solv, Id pi, Rule *r, Map *m) ++solver_choicerulecheck(Solver *solv, Id pi, Rule *r, Map *m, Queue *q) + { + Pool *pool = solv->pool; + Rule *ur; +- Queue q; +- Id p, pp, qbuf[32]; ++ Id p, pp; + int i; + +- ur = solv->rules + solv->updaterules + (pi - pool->installed->start); +- if (!ur->p) +- ur = solv->rules + solv->featurerules + (pi - pool->installed->start); +- if (!ur->p) +- return 0; +- queue_init_buffer(&q, qbuf, sizeof(qbuf)/sizeof(*qbuf)); +- FOR_RULELITERALS(p, pp, ur) +- if (p > 0) +- queue_push(&q, p); +- if (q.count > 1) +- policy_filter_unwanted(solv, &q, POLICY_MODE_CHOOSE); +- for (i = 0; i < q.count; i++) +- if (MAPTST(m, q.elements[i])) +- break; +- /* 1: none of the newest versions provide it */ +- i = i == q.count ? 1 : 0; +- queue_free(&q); +- return i; ++ if (!q->count || q->elements[0] != pi) ++ { ++ if (q->count) ++ queue_empty(q); ++ ur = solv->rules + solv->updaterules + (pi - pool->installed->start); ++ if (!ur->p) ++ ur = solv->rules + solv->featurerules + (pi - pool->installed->start); ++ if (!ur->p) ++ return 0; ++ queue_push2(q, pi, 0); ++ FOR_RULELITERALS(p, pp, ur) ++ if (p > 0) ++ queue_push(q, p); ++ } ++ if (q->count == 2) ++ return 1; ++ if (q->count == 3) ++ { ++ p = q->elements[2]; ++ return MAPTST(m, p) ? 0 : 1; ++ } ++ if (!q->elements[1]) ++ { ++ for (i = 2; i < q->count; i++) ++ if (!MAPTST(m, q->elements[i])) ++ break; ++ if (i == q->count) ++ return 0; /* all provide it, no need to filter */ ++ /* some don't provide it, have to filter */ ++ queue_deleten(q, 0, 2); ++ policy_filter_unwanted(solv, q, POLICY_MODE_CHOOSE); ++ queue_unshift(q, 1); /* filter mark */ ++ queue_unshift(q, pi); ++ } ++ for (i = 2; i < q->count; i++) ++ if (MAPTST(m, q->elements[i])) ++ return 0; /* at least one provides it */ ++ return 1; /* none of the new packages provided it */ + } + + static inline void +@@ -2883,7 +2902,7 @@ solver_addchoicerules(Solver *solv) + Pool *pool = solv->pool; + Map m, mneg; + Rule *r; +- Queue q, qi; ++ Queue q, qi, qcheck; + int i, j, rid, havechoice; + Id p, d, pp; + Id p2, pp2; +@@ -2902,6 +2921,7 @@ solver_addchoicerules(Solver *solv) + solv->choicerules_ref = solv_calloc(solv->pkgrules_end, sizeof(Id)); + queue_init(&q); + queue_init(&qi); ++ queue_init(&qcheck); + map_init(&m, pool->nsolvables); + map_init(&mneg, pool->nsolvables); + /* set up negative assertion map from infarch and dup rules */ +@@ -3019,7 +3039,7 @@ solver_addchoicerules(Solver *solv) + p2 = qi.elements[i]; + if (!p2) + continue; +- if (solver_choicerulecheck(solv, p2, r, &m)) ++ if (solver_choicerulecheck(solv, p2, r, &m, &qcheck)) + { + /* oops, remove element p from q */ + queue_removeelement(&q, qi.elements[i + 1]); +@@ -3028,6 +3048,7 @@ solver_addchoicerules(Solver *solv) + qi.elements[j++] = p2; + } + queue_truncate(&qi, j); ++ + if (!q.count || !qi.count) + { + FOR_RULELITERALS(p, pp, r) +@@ -3099,6 +3120,7 @@ solver_addchoicerules(Solver *solv) + } + queue_free(&q); + queue_free(&qi); ++ queue_free(&qcheck); + map_free(&m); + map_free(&mneg); + solv->choicerules_end = solv->nrules; +-- +2.4.3 + diff --git a/0006-Make-keep_orphans-also-keep-multiversion-orphans-ins.patch b/0006-Make-keep_orphans-also-keep-multiversion-orphans-ins.patch new file mode 100644 index 0000000..337256a --- /dev/null +++ b/0006-Make-keep_orphans-also-keep-multiversion-orphans-ins.patch @@ -0,0 +1,41 @@ +From 8542225bad5c1616b4ebe1ab78a6bf320726afd9 Mon Sep 17 00:00:00 2001 +From: Michael Schroeder +Date: Wed, 14 Oct 2015 14:30:46 +0200 +Subject: [PATCH 6/6] Make keep_orphans also keep multiversion orphans + installed + +Also make keep_orphanse add multiversion orphans to the +update rule, thus enforcing that they stay installed. +--- + src/rules.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/src/rules.c b/src/rules.c +index 97ccc6e..381cb22 100644 +--- a/src/rules.c ++++ b/src/rules.c +@@ -1302,6 +1302,8 @@ solver_addupdaterule(Solver *solv, Solvable *s, int allow_all) + if (j == 0 && p == -SYSTEMSOLVABLE && solv->dupmap_all) + { + queue_push(&solv->orphaned, s - pool->solvables); /* also treat as orphaned */ ++ if (solv->keep_orphans && !(solv->droporphanedmap_all || (solv->droporphanedmap.size && MAPTST(&solv->droporphanedmap, s - pool->solvables - solv->installed->start)))) ++ p = s - pool->solvables; /* keep this orphaned package installed */ + j = qs.count; + } + qs.count = j; +@@ -1844,6 +1846,12 @@ solver_addduprules(Solver *solv, Map *addedmap) + r += solv->updaterules - solv->featurerules; + if (r->p == p && !r->d) + ip = p; ++ else if (solv->dupmap_all && solv->multiversion.size) ++ { ++ r = solv->rules + solv->updaterules + (p - solv->installed->start); ++ if (r->p == p) ++ ip = p; ++ } + } + if (!ip) + solver_addrule(solv, -p, 0, 0); /* no match, sorry */ +-- +2.4.3 + diff --git a/libsolv-rubyinclude.patch b/libsolv-rubyinclude.patch deleted file mode 100644 index 45982c9..0000000 --- a/libsolv-rubyinclude.patch +++ /dev/null @@ -1,30 +0,0 @@ -diff -up libsolv/bindings/ruby/CMakeLists.txt.rubyinclude libsolv/bindings/ruby/CMakeLists.txt ---- libsolv/bindings/ruby/CMakeLists.txt.rubyinclude 2012-06-07 10:06:19.372687533 +0200 -+++ libsolv/bindings/ruby/CMakeLists.txt 2012-06-07 10:09:57.313968719 +0200 -@@ -6,8 +6,17 @@ ELSE (USE_VENDORDIRS AND RUBY_VENDORARCH - SET (RUBY_INSTALL_DIR ${RUBY_SITEARCH_DIR}) - ENDIF (USE_VENDORDIRS AND RUBY_VENDORARCH_DIR) - -+EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['arch']" -+ OUTPUT_VARIABLE RUBY_ARCH) -+ -+EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['rubyhdrdir']" -+ OUTPUT_VARIABLE RUBY_HDR_DIR) -+ -+SET(RUBY_INCLUDE_DIRS ${RUBY_HDR_DIR} ${RUBY_HDR_DIR}/${RUBY_ARCH}) -+ - MESSAGE (STATUS "Ruby executable: ${RUBY_EXECUTABLE}") - MESSAGE (STATUS "Ruby installation dir: ${RUBY_INSTALL_DIR}") -+MESSAGE (STATUS "Ruby include dir: ${RUBY_INCLUDE_DIRS}") - - ADD_CUSTOM_COMMAND ( - OUTPUT solv_ruby.c -@@ -17,7 +26,7 @@ ADD_CUSTOM_COMMAND ( - ) - - ADD_DEFINITIONS(-Wno-unused) --INCLUDE_DIRECTORIES (${RUBY_INCLUDE_PATH}) -+INCLUDE_DIRECTORIES (${RUBY_INCLUDE_DIRS}) - - ADD_LIBRARY (bindings_ruby SHARED solv_ruby.c) - SET_TARGET_PROPERTIES (bindings_ruby PROPERTIES PREFIX "" OUTPUT_NAME "solv") diff --git a/libsolv.spec b/libsolv.spec index a655893..f77b4a8 100644 --- a/libsolv.spec +++ b/libsolv.spec @@ -1,21 +1,64 @@ -%global gitrev 2db517f87a8c0364d28c0fa2590ba034e866a4b8 %{!?ruby_vendorarch: %global ruby_vendorarch %(ruby -r rbconfig -e "puts RbConfig::CONFIG['vendorarchdir'].nil? ? RbConfig::CONFIG['sitearchdir'] : RbConfig::CONFIG['vendorarchdir']")} %filter_provides_in %{perl_vendorarch}/.*\.so$ -%filter_provides_in %{python_sitearch}/.*\.so$ +%filter_provides_in %{hon2_sitearch}/.*\.so$ +%if 0%{?fedora} +%bcond_without python3 +%filter_provides_in %{python3_sitearch}/.*\.so$ +%global _cmake_opts \\\ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \\\ + -DENABLE_PERL=1 \\\ + -DENABLE_PYTHON=1 \\\ + -DENABLE_RUBY=1 \\\ + -DUSE_VENDORDIRS=1 \\\ + -DFEDORA=1 \\\ + -DENABLE_DEBIAN=1 \\\ + -DENABLE_ARCHREPO=1 \\\ + -DENABLE_LZMA_COMPRESSION=1 \\\ + -DMULTI_SEMANTICS=1 \\\ + -DENABLE_COMPLEX_DEPS=1 \\\ + %{nil} +%else +%bcond_with python3 +%global _cmake_opts \\\ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \\\ + -DFEDORA=1 \\\ + -DENABLE_LZMA_COMPRESSION=1 \\\ + %{nil} +%endif %filter_provides_in %{ruby_vendorarch}/.*\.so$ %filter_setup Name: libsolv -Version: 0.6.11 +Version: 0.6.14 Release: 2%{?dist} License: BSD Url: https://github.com/openSUSE/libsolv -Source: https://github.com/openSUSE/libsolv/archive/%{gitrev}.tar.gz -Patch0: libsolv-rubyinclude.patch +Source: https://github.com/openSUSE/libsolv/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz +Patch0: 0001-ruby-make-compatible-with-ruby-2.2.patch + +Patch1: 0001-Move-allowuninstall-map-creation.patch +Patch2: 0002-Prefer-to-autouninstall-orphans.patch +Patch3: 0003-Check-keep_orphans-flag-in-solver_addduprules.patch +Patch4: 0004-Fix-spelling-duh.patch +Patch5: 0001-Simplify-solver_addduprules-a-bit.patch +Patch6: 0002-Drop-inline-from-solver_addtodupmaps.patch +Patch7: 0003-Rename-hasdupjobs-to-needduprules.patch +Patch8: 0004-Fix-typo-in-comment.patch +Patch9: 0005-Speed-up-choice-rule-generation.patch +Patch10: 0006-Make-keep_orphans-also-keep-multiversion-orphans-ins.patch + +BuildRequires: git-core + Group: Development/Libraries Summary: Package dependency solver BuildRequires: cmake libdb-devel expat-devel rpm-devel zlib-devel -BuildRequires: swig perl perl-devel ruby ruby-devel python2-devel +BuildRequires: swig +%if 0%{?fedora} +BuildRequires: perl perl-devel ruby ruby-devel python2-devel +%endif +%if %{with python3} +BuildRequires: python3-devel +%endif BuildRequires: xz-devel %description A free package dependency solver using a satisfiability algorithm. The @@ -55,6 +98,7 @@ Requires: curl gnupg2 %description demo Applications demoing the libsolv library. +%if 0%{?fedora} %package -n ruby-solv Summary: Ruby bindings for the libsolv library Group: Development/Languages @@ -62,16 +106,33 @@ Requires: libsolv%{?_isa} = %{version}-%{release} %description -n ruby-solv Ruby bindings for sat solver. +%endif +%if 0%{?fedora} %package -n python-solv Summary: Python bindings for the libsolv library Group: Development/Languages -Requires: python +Requires: python2 Requires: libsolv%{?_isa} = %{version}-%{release} +%{?python_provide:%python_provide python-solv} %description -n python-solv Python bindings for sat solver. +%endif + +%if %{with python3} +%package -n python3-solv +Summary: Python 3 bindings for the libsolv library +Group: Development/Languages +Requires: python3 +Requires: libsolv%{?_isa} = %{version}-%{release} +%{?python_provide:%python_provide python3-solv} + +%description -n python3-solv +Python 3 bindings for sat solver. +%endif +%if 0%{?fedora} %package -n perl-solv Summary: Perl bindings for the libsolv library Group: Development/Languages @@ -80,31 +141,40 @@ Requires: libsolv%{?_isa} = %{version}-%{release} %description -n perl-solv Perl bindings for sat solver. +%endif %prep -%setup -q -n libsolv-%{gitrev} -%patch0 -p1 -b .rubyinclude +%autosetup -S git -%check -make ARGS="-V" test +%if %{with python3} +rm -rf %{py3dir} +cp -a . %{py3dir} +%endif %build -%cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \ - -DENABLE_PERL=1 \ - -DENABLE_PYTHON=1 \ - -DENABLE_RUBY=1 \ - -DUSE_VENDORDIRS=1 \ - -DFEDORA=1 \ - -DENABLE_DEBIAN=1 \ - -DENABLE_ARCHREPO=1 \ - -DENABLE_LZMA_COMPRESSION=1 \ - -DMULTI_SEMANTICS=1 - +%cmake %_cmake_opts \ + -DPythonLibs_FIND_VERSION=2 -DPythonLibs_FIND_VERSION_MAJOR=2 make %{?_smp_mflags} +%if %{with python3} +pushd %{py3dir}/ + %cmake %_cmake_opts \ + -DPythonLibs_FIND_VERSION=3 -DPythonLibs_FIND_VERSION_MAJOR=3 + make %{?_smp_mflags} +popd +%endif + %install -make DESTDIR=$RPM_BUILD_ROOT install -rm $RPM_BUILD_ROOT/usr/bin/testsolv +%make_install + +%if %{with python3} +pushd %{py3dir}/ + %make_install +popd +%endif + +%check +make ARGS="-V" test %post -p /sbin/ldconfig @@ -116,9 +186,11 @@ rm $RPM_BUILD_ROOT/usr/bin/testsolv %_libdir/libsolvext.so.* %files tools +%if 0%{?fedora} %_bindir/archpkgs2solv %_bindir/archrepo2solv %_bindir/deb2solv +%endif %_bindir/deltainfoxml2solv %_bindir/dumpsolv %_bindir/installcheck @@ -128,19 +200,22 @@ rm $RPM_BUILD_ROOT/usr/bin/testsolv %_bindir/rpmdb2solv %_bindir/rpmmd2solv %_bindir/rpms2solv +%_bindir/testsolv %_bindir/updateinfoxml2solv %files devel -%doc examples/solv.c +%doc examples/solv/ %_libdir/libsolv.so %_libdir/libsolvext.so %_includedir/solv %_datadir/cmake/Modules/FindLibSolv.cmake %{_mandir}/man?/* +%{_libdir}/pkgconfig/%{name}.pc %files demo %_bindir/solv +%if 0%{?fedora} %files -n perl-solv %doc examples/p5solv %{perl_vendorarch}/* @@ -151,9 +226,32 @@ rm $RPM_BUILD_ROOT/usr/bin/testsolv %files -n python-solv %doc examples/pysolv -%{python_sitearch}/* +%{python2_sitearch}/* +%endif + +%if %{with python3} +%files -n python3-solv +%doc examples/pysolv +%{python3_sitearch}/* +%endif %changelog +* Wed Oct 14 2015 Michal Luscon - 0.6.14-2 +- Backport patches from upstream + +* Mon Oct 12 2015 Igor Gnatenko - 0.6.14-1 +- Update to 0.6.14 +- Backport patches from upstream + +* Thu Sep 10 2015 Igor Gnatenko - 0.6.12-1 +- Update to 0.6.12 + +* Wed Aug 05 2015 Jan Silhan - 0.6.11-3 +- added compile flag to support rich dependencies +- new version adding MIPS support +- Distribute testsolv in -tools subpackage (Igor Gnatenko) +- Enable python3 bindings for fedora (Igor Gnatenko) + * Tue Aug 04 2015 Adam Williamson - 0.6.11-2 - make bindings require the exact matching version of the lib (#1243737)