From: Michael Schroeder Date: Tue, 4 Jun 2013 11:18:33 +0000 (+0200) Subject: add POOL_FLAG_IMPLICITOBSOLETEUSESCOLORS to match the current rpm behaviour X-Git-Tag: BASE-SuSE-Code-13_1-Branch~118 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee3a248c51e0189eeacafaf3a27fc1571af04253;p=thirdparty%2Flibsolv.git add POOL_FLAG_IMPLICITOBSOLETEUSESCOLORS to match the current rpm behaviour Sigh. I hope that's the last time rpm changes the way it handles obsoletes. --- diff --git a/bindings/solv.i b/bindings/solv.i index 8ab7ab29..f2be5400 100644 --- a/bindings/solv.i +++ b/bindings/solv.i @@ -1036,6 +1036,7 @@ typedef struct { static const int POOL_FLAG_OBSOLETEUSESPROVIDES = POOL_FLAG_OBSOLETEUSESPROVIDES; static const int POOL_FLAG_IMPLICITOBSOLETEUSESPROVIDES = POOL_FLAG_IMPLICITOBSOLETEUSESPROVIDES; static const int POOL_FLAG_OBSOLETEUSESCOLORS = POOL_FLAG_OBSOLETEUSESCOLORS; + static const int POOL_FLAG_IMPLICITOBSOLETEUSESCOLORS = POOL_FLAG_IMPLICITOBSOLETEUSESCOLORS; static const int POOL_FLAG_NOINSTALLEDOBSOLETES = POOL_FLAG_NOINSTALLEDOBSOLETES; static const int POOL_FLAG_HAVEDISTEPOCH = POOL_FLAG_HAVEDISTEPOCH; static const int POOL_FLAG_NOOBSOLETESMULTIVERSION = POOL_FLAG_NOOBSOLETESMULTIVERSION; diff --git a/doc/libsolv-bindings.3 b/doc/libsolv-bindings.3 index e956e161..7582e0a2 100644 --- a/doc/libsolv-bindings.3 +++ b/doc/libsolv-bindings.3 @@ -2,12 +2,12 @@ .\" Title: libsolv-bindings .\" Author: [see the "Author" section] .\" Generator: DocBook XSL Stylesheets v1.76.1 -.\" Date: 06/03/2013 +.\" Date: 06/04/2013 .\" Manual: LIBSOLV .\" Source: libsolv .\" Language: English .\" -.TH "LIBSOLV\-BINDINGS" "3" "06/03/2013" "libsolv" "LIBSOLV" +.TH "LIBSOLV\-BINDINGS" "3" "06/04/2013" "libsolv" "LIBSOLV" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -136,7 +136,12 @@ An implicit obsoletes is the internal mechanism to remove the old package on an .PP \fBPOOL_FLAG_OBSOLETEUSESCOLORS\fR .RS 4 -Rpm\(cqs multilib implementation (used in RedHat and Fedora) distinguishes between 32bit and 64bit packages (the terminology is that they have a different color)\&. If obsolteusescolors is set, packages with different colors will not obsolete each other\&. This is also true for implicit obsoletes, thus you can install both the 32bit and the 64bit version of a package with the same name\&. +Rpm\(cqs multilib implementation (used in RedHat and Fedora) distinguishes between 32bit and 64bit packages (the terminology is that they have a different color)\&. If obsolteusescolors is set, packages with different colors will not obsolete each other\&. +.RE +.PP +\fBPOOL_FLAG_IMPLICITOBSOLETEUSESCOLORS\fR +.RS 4 +Same as POOL_FLAG_OBSOLETEUSESCOLORS, but used to find out if packages of the same name can be installed in parallel\&. For current Fedora systems, POOL_FLAG_OBSOLETEUSESCOLORS should be false and POOL_FLAG_IMPLICITOBSOLETEUSESCOLORS should be true (this is the default if FEDORA is defined when libsolv is compiled)\&. .RE .PP \fBPOOL_FLAG_NOINSTALLEDOBSOLETES\fR diff --git a/doc/libsolv-bindings.txt b/doc/libsolv-bindings.txt index 3601d986..dca24c1b 100644 --- a/doc/libsolv-bindings.txt +++ b/doc/libsolv-bindings.txt @@ -88,9 +88,14 @@ Define which repository contains all the installed packages. distinguishes between 32bit and 64bit packages (the terminology is that they have a different color). If obsolteusescolors is set, packages with different colors will not obsolete each other. - This is also true for implicit obsoletes, thus you can install - both the 32bit and the 64bit version of a package with the - same name. + +*POOL_FLAG_IMPLICITOBSOLETEUSESCOLORS*:: + Same as POOL_FLAG_OBSOLETEUSESCOLORS, but used to find out if + packages of the same name can be installed in parallel. For + current Fedora systems, POOL_FLAG_OBSOLETEUSESCOLORS should be + false and POOL_FLAG_IMPLICITOBSOLETEUSESCOLORS should be true + (this is the default if FEDORA is defined when libsolv is + compiled). *POOL_FLAG_NOINSTALLEDOBSOLETES*:: New versions of rpm consider the obsoletes of installed packages diff --git a/ext/testcase.c b/ext/testcase.c index 77b5fabd..1db90518 100644 --- a/ext/testcase.c +++ b/ext/testcase.c @@ -110,6 +110,7 @@ static struct poolflags2str { { POOL_FLAG_OBSOLETEUSESPROVIDES, "obsoleteusesprovides", 0 }, { POOL_FLAG_IMPLICITOBSOLETEUSESPROVIDES, "implicitobsoleteusesprovides", 0 }, { POOL_FLAG_OBSOLETEUSESCOLORS, "obsoleteusescolors", 0 }, + { POOL_FLAG_IMPLICITOBSOLETEUSESCOLORS, "implicitobsoleteusescolors", 0 }, { POOL_FLAG_NOINSTALLEDOBSOLETES, "noinstalledobsoletes", 0 }, { POOL_FLAG_HAVEDISTEPOCH, "havedistepoch", 0 }, { POOL_FLAG_NOOBSOLETESMULTIVERSION, "noobsoletesmultiversion", 0 }, diff --git a/src/policy.c b/src/policy.c index 915c865e..c3385d8b 100644 --- a/src/policy.c +++ b/src/policy.c @@ -871,6 +871,7 @@ policy_findupdatepackages(Solver *solv, Solvable *s, Queue *qs, int allow_all) ps = pool->solvables + p; if (s->name == ps->name) /* name match */ { + /* XXX: check implicitobsoleteusescolors? */ if (!allowdowngrade && pool_evrcmp(pool, s->evr, ps->evr, EVRCMP_COMPARE) > 0) continue; } diff --git a/src/pool.c b/src/pool.c index 6eea5ea3..06f1e9e5 100644 --- a/src/pool.c +++ b/src/pool.c @@ -81,7 +81,7 @@ pool_create(void) pool->debugmask = SOLV_DEBUG_RESULT; /* FIXME */ #ifdef FEDORA - pool->obsoleteusescolors = 1; + pool->implicitobsoleteusescolors = 1; #endif #ifdef RPM5 pool->noobsoletesmultiversion = 1; @@ -171,6 +171,8 @@ pool_get_flag(Pool *pool, int flag) return pool->implicitobsoleteusesprovides; case POOL_FLAG_OBSOLETEUSESCOLORS: return pool->obsoleteusescolors; + case POOL_FLAG_IMPLICITOBSOLETEUSESCOLORS: + return pool->implicitobsoleteusescolors; case POOL_FLAG_NOINSTALLEDOBSOLETES: return pool->noinstalledobsoletes; case POOL_FLAG_HAVEDISTEPOCH: @@ -206,6 +208,9 @@ pool_set_flag(Pool *pool, int flag, int value) case POOL_FLAG_OBSOLETEUSESCOLORS: pool->obsoleteusescolors = value; break; + case POOL_FLAG_IMPLICITOBSOLETEUSESCOLORS: + pool->implicitobsoleteusescolors = value; + break; case POOL_FLAG_NOINSTALLEDOBSOLETES: pool->noinstalledobsoletes = value; break; diff --git a/src/pool.h b/src/pool.h index 1da09bcb..a3cb364c 100644 --- a/src/pool.h +++ b/src/pool.h @@ -128,6 +128,7 @@ struct _Pool { int obsoleteusesprovides; /* true: obsoletes are matched against provides, not names */ int implicitobsoleteusesprovides; /* true: implicit obsoletes due to same name are matched against provides, not names */ int obsoleteusescolors; /* true: obsoletes check arch color */ + int implicitobsoleteusescolors; /* true: implicit obsoletes check arch color */ int noinstalledobsoletes; /* true: ignore obsoletes of installed packages */ int forbidselfconflicts; /* true: packages which conflict with itself are not installable */ int noobsoletesmultiversion; /* true: obsoletes are ignored for multiversion installs */ @@ -188,6 +189,7 @@ struct _Pool { #define POOL_FLAG_HAVEDISTEPOCH 7 #define POOL_FLAG_NOOBSOLETESMULTIVERSION 8 #define POOL_FLAG_ADDFILEPROVIDESFILTERED 9 +#define POOL_FLAG_IMPLICITOBSOLETEUSESCOLORS 10 /* ----------------------------------------------- */ diff --git a/src/rules.c b/src/rules.c index 1c3244ca..ae14eba3 100644 --- a/src/rules.c +++ b/src/rules.c @@ -719,7 +719,7 @@ solver_addrpmrulesforsolvable(Solver *solv, Solvable *s, Map *m) continue; if (!pool->implicitobsoleteusesprovides && s->name != ps->name) continue; - if (pool->obsoleteusescolors && !pool_colormatch(pool, s, ps)) + if (pool->implicitobsoleteusescolors && !pool_colormatch(pool, s, ps)) continue; if (s->name == ps->name) addrpmrule(solv, -n, -p, SOLVER_RULE_RPM_SAME_NAME, 0); @@ -1496,7 +1496,7 @@ add_obsoletes(Solver *solv, Id p, Queue *q) continue; if (!pool->implicitobsoleteusesprovides && ps->name != s->name) continue; - if (pool->obsoleteusescolors && !pool_colormatch(pool, s, ps)) + if (pool->implicitobsoleteusescolors && !pool_colormatch(pool, s, ps)) continue; queue_push(q, p2); lastp2 = p2; @@ -2420,7 +2420,7 @@ solver_addchoicerules(Solver *solv) continue; if (!pool->implicitobsoleteusesprovides && s->name != s2->name) continue; - if (pool->obsoleteusescolors && !pool_colormatch(pool, s, s2)) + if (pool->implicitobsoleteusescolors && !pool_colormatch(pool, s, s2)) continue; break; } diff --git a/src/solver.c b/src/solver.c index a3369ce6..052c834a 100644 --- a/src/solver.c +++ b/src/solver.c @@ -2954,7 +2954,7 @@ solver_solve(Solver *solv, Queue *job) POOL_DEBUG(SOLV_DEBUG_STATS, "dosplitprovides=%d, noupdateprovide=%d, noinfarchcheck=%d\n", solv->dosplitprovides, solv->noupdateprovide, solv->noinfarchcheck); POOL_DEBUG(SOLV_DEBUG_STATS, "allowuninstall=%d, allowdowngrade=%d, allownamechange=%d, allowarchchange=%d, allowvendorchange=%d\n", solv->allowuninstall, solv->allowdowngrade, solv->allownamechange, solv->allowarchchange, solv->allowvendorchange); POOL_DEBUG(SOLV_DEBUG_STATS, "promoteepoch=%d, forbidselfconflicts=%d\n", pool->promoteepoch, pool->forbidselfconflicts); - POOL_DEBUG(SOLV_DEBUG_STATS, "obsoleteusesprovides=%d, implicitobsoleteusesprovides=%d, obsoleteusescolors=%d\n", pool->obsoleteusesprovides, pool->implicitobsoleteusesprovides, pool->obsoleteusescolors); + POOL_DEBUG(SOLV_DEBUG_STATS, "obsoleteusesprovides=%d, implicitobsoleteusesprovides=%d, obsoleteusescolors=%d, implicitobsoleteusescolors=%d\n", pool->obsoleteusesprovides, pool->implicitobsoleteusesprovides, pool->obsoleteusescolors, pool->implicitobsoleteusescolors); POOL_DEBUG(SOLV_DEBUG_STATS, "dontinstallrecommended=%d, addalreadyrecommended=%d\n", solv->dontinstallrecommended, solv->addalreadyrecommended); /* create whatprovides if not already there */ @@ -3549,7 +3549,7 @@ solver_solve(Solver *solv, Queue *job) if (!solv->noinfarchcheck) { solver_addinfarchrules(solv, &addedmap); - if (pool->obsoleteusescolors) + if (pool->implicitobsoleteusescolors) { /* currently doesn't work well with infarch rules, so make * them weak */ diff --git a/src/transaction.c b/src/transaction.c index cf039cff..65c4bc5f 100644 --- a/src/transaction.c +++ b/src/transaction.c @@ -587,7 +587,7 @@ create_transaction_info(Transaction *trans, Queue *decisionq) continue; if (!pool->implicitobsoleteusesprovides && s->name != s2->name) continue; - if (pool->obsoleteusescolors && !pool_colormatch(pool, s, s2)) + if (pool->implicitobsoleteusescolors && !pool_colormatch(pool, s, s2)) continue; queue_push2(ti, p, p2); }