From 982e0fa340f1bbbeee589f322b0b6757fa4597c4 Mon Sep 17 00:00:00 2001 From: Michael Schroeder Date: Fri, 26 Apr 2013 14:49:55 +0200 Subject: bring libsolv in line with currrent rpm's multiversion handling A multiversion install still obeys the obsoletes of a package. The solver already had a flag to support this, "keepexplicitobsoletes", but as this is a feature of the package manager it belongs in the pool, so that the transaction code can do the right thing. We now have a "noobsoletesmultiversion" flag in the pool that also defines the default for "keepexplicitobsoletes". --- src/transaction.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/transaction.c') diff --git a/src/transaction.c b/src/transaction.c index 94f0236..cf039cf 100644 --- a/src/transaction.c +++ b/src/transaction.c @@ -46,6 +46,7 @@ obsq_sortcmp(const void *ap, const void *bp, void *dp) obs = pool->solvables + ob; if (oas->name != obs->name) { + /* bring "same name" obsoleters (i.e. upgraders) to front */ if (oas->name == s->name) return -1; if (obs->name == s->name) @@ -165,9 +166,19 @@ transaction_base_type(Transaction *trans, Id p) } else { + /* install or multiinstall */ int multi = trans->multiversionmap.size && MAPTST(&trans->multiversionmap, p); if (multi) - return p2 ? SOLVER_TRANSACTION_MULTIREINSTALL : SOLVER_TRANSACTION_MULTIINSTALL; + { + if (p2) + { + s = pool->solvables + p; + s2 = pool->solvables + p2; + if (s->name == s2->name && s->arch == s2->arch && s->evr == s2->evr) + return SOLVER_TRANSACTION_MULTIREINSTALL; + } + return SOLVER_TRANSACTION_MULTIINSTALL; + } if (!p2) return SOLVER_TRANSACTION_INSTALL; s = pool->solvables + p; @@ -580,7 +591,7 @@ create_transaction_info(Transaction *trans, Queue *decisionq) continue; queue_push2(ti, p, p2); } - if (s->obsoletes && !multi) + if (s->obsoletes && (!multi || !pool->noobsoletesmultiversion)) { Id obs, *obsp = s->repo->idarraydata + s->obsoletes; while ((obs = *obsp++) != 0) -- cgit v1.2.3