diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2016-10-27 14:57:15 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2016-10-27 14:57:15 +0900 |
commit | be2d42493b7600c4bdff046181f1519a3d44b13c (patch) | |
tree | 749d4a7afa55c65fee9a7188da204a6fe4660208 /src/rules.c | |
parent | 19032dd0c1d2167793399473a1b490be1b635d17 (diff) | |
download | libsolv-be2d42493b7600c4bdff046181f1519a3d44b13c.tar.gz libsolv-be2d42493b7600c4bdff046181f1519a3d44b13c.tar.bz2 libsolv-be2d42493b7600c4bdff046181f1519a3d44b13c.zip |
Imported Upstream version 0.6.17upstream/0.6.17
Change-Id: I2c27bcda07cba71c27b3bef00710dd730e5e0be7
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'src/rules.c')
-rw-r--r-- | src/rules.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/rules.c b/src/rules.c index 70d6b07..6f35720 100644 --- a/src/rules.c +++ b/src/rules.c @@ -1206,6 +1206,17 @@ addduppackages(Solver *solv, Solvable *s, Queue *qs) } #endif +/* stash away the original updaters for multiversion packages. We do this so that + * we can update the package later */ +static inline void +set_specialupdaters(Solver *solv, Solvable *s, Id d) +{ + Repo *installed = solv->installed; + if (!solv->specialupdaters) + solv->specialupdaters = solv_calloc(installed->end - installed->start, sizeof(Id)); + solv->specialupdaters[s - solv->pool->solvables - installed->start] = d; +} + /*------------------------------------------------------------------- * * add rule for update @@ -1245,9 +1256,8 @@ solver_addupdaterule(Solver *solv, Solvable *s, int allow_all) { if (p != -SYSTEMSOLVABLE) queue_unshift(&qs, p); - if (!solv->specialupdaters) - solv->specialupdaters = solv_calloc(solv->installed->end - solv->installed->start, sizeof(Id)); - solv->specialupdaters[s - pool->solvables - solv->installed->start] = pool_queuetowhatprovides(pool, &qs); + if (qs.count) + set_specialupdaters(solv, s, pool_queuetowhatprovides(pool, &qs)); } queue_free(&qs); return; @@ -1300,9 +1310,7 @@ solver_addupdaterule(Solver *solv, Solvable *s, int allow_all) { /* this is a multiversion orphan */ queue_push(&solv->orphaned, s - pool->solvables); - if (!solv->specialupdaters) - solv->specialupdaters = solv_calloc(solv->installed->end - solv->installed->start, sizeof(Id)); - solv->specialupdaters[s - pool->solvables - solv->installed->start] = d; + set_specialupdaters(solv, s, d); if (solv->keep_orphans && !(solv->droporphanedmap_all || (solv->droporphanedmap.size && MAPTST(&solv->droporphanedmap, s - pool->solvables - solv->installed->start)))) { /* we need to keep the orphan */ @@ -1314,6 +1322,11 @@ solver_addupdaterule(Solver *solv, Solvable *s, int allow_all) isorphaned = 1; j = qs.count; /* force the update */ } + else if (d && (solv->updatemap_all || (solv->updatemap.size && MAPTST(&solv->updatemap, s - pool->solvables - solv->installed->start)))) + { + /* non-orphan multiversion package, set special updaters if we want an update */ + set_specialupdaters(solv, s, d); + } qs.count = j; } else if (p != -SYSTEMSOLVABLE) |