diff options
author | Michael Schroeder <mls@suse.de> | 2012-11-16 14:48:38 +0100 |
---|---|---|
committer | Michael Schroeder <mls@suse.de> | 2012-11-16 14:48:38 +0100 |
commit | 1275cec995ca89ed6b7871574ff945d9007f79a3 (patch) | |
tree | 8230163683f3582bd516d3a195465319f5aa2808 | |
parent | ff2c015c82e527f4af2dcb7b41a4d7f25d9ec4e0 (diff) | |
download | libsolv-1275cec995ca89ed6b7871574ff945d9007f79a3.tar.gz libsolv-1275cec995ca89ed6b7871574ff945d9007f79a3.tar.bz2 libsolv-1275cec995ca89ed6b7871574ff945d9007f79a3.zip |
do not reinstall identical packages in targeted update
-rw-r--r-- | src/solver.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/solver.c b/src/solver.c index 77dda72..56c57d2 100644 --- a/src/solver.c +++ b/src/solver.c @@ -2605,9 +2605,12 @@ add_update_target(Solver *solv, Id p) FOR_PROVIDES(pi, pip, s->name) { Solvable *si = pool->solvables + pi; - if (si->name != s->name || si->repo != installed) + if (si->repo != installed || si->name != s->name) continue; queue_push2(solv->update_targets, pi, p); + /* check if it's ok to keep the installed package */ + if (s->evr == si->evr && solvable_identical(s, si)) + queue_push2(solv->update_targets, pi, pi); } if (s->obsoletes) { @@ -2619,6 +2622,8 @@ add_update_target(Solver *solv, Id p) Solvable *si = pool->solvables + pi; if (si->repo != installed) continue; + if (si->name == s->name) + continue; /* already handled above */ if (!pool->obsoleteusesprovides && !pool_match_nevr(pool, si, obs)) continue; if (pool->obsoleteusescolors && !pool_colormatch(pool, s, si)) @@ -3834,8 +3839,12 @@ pool_isemptyupdatejob(Pool *pool, Id how, Id what) { Solvable *s = pool->solvables + p; FOR_PROVIDES(pi, pip, s->name) - if (pool->solvables[pi].name == s->name && pool->solvables[pi].repo == pool->installed) + { + Solvable *si = pool->solvables + pi; + if (si->repo != pool->installed || si->name != s->name) + continue; return 0; + } if (s->obsoletes) { Id obs, *obsp = s->repo->idarraydata + s->obsoletes; |