summaryrefslogtreecommitdiff
path: root/src/transaction.c
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2013-04-26 14:49:55 +0200
committerMichael Schroeder <mls@suse.de>2013-04-26 14:49:55 +0200
commit982e0fa340f1bbbeee589f322b0b6757fa4597c4 (patch)
treec8ced36f65025eda7592a0dc91709ac1b617c699 /src/transaction.c
parentb188af052a5091e05ea8b4e35b25b0456a88b09d (diff)
downloadlibsolv-982e0fa340f1bbbeee589f322b0b6757fa4597c4.tar.gz
libsolv-982e0fa340f1bbbeee589f322b0b6757fa4597c4.tar.bz2
libsolv-982e0fa340f1bbbeee589f322b0b6757fa4597c4.zip
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".
Diffstat (limited to 'src/transaction.c')
-rw-r--r--src/transaction.c15
1 files changed, 13 insertions, 2 deletions
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)