diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2016-10-27 14:52:55 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2016-10-27 14:53:17 +0900 |
commit | ba4d7201b44ecec1182b53571d98b2be4ca50264 (patch) | |
tree | 099cf6127f7020528a4d05083fc059cbf3ad7db5 /src/pool.c | |
parent | 1be9896f3702c4996e1a43e1c9b5c18366ff42b9 (diff) | |
download | libsolv-ba4d7201b44ecec1182b53571d98b2be4ca50264.tar.gz libsolv-ba4d7201b44ecec1182b53571d98b2be4ca50264.tar.bz2 libsolv-ba4d7201b44ecec1182b53571d98b2be4ca50264.zip |
Imported Upstream version 0.6.5upstream/0.6.5
Change-Id: If69a2170a61800e3f778ec1f78364531c9642950
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'src/pool.c')
-rw-r--r-- | src/pool.c | 58 |
1 files changed, 48 insertions, 10 deletions
@@ -118,7 +118,7 @@ pool_free(Pool *pool) solv_free(pool->tmpspace.buf[i]); for (i = 0; i < pool->nlanguages; i++) free((char *)pool->languages[i]); - solv_free(pool->languages); + solv_free((void *)pool->languages); solv_free(pool->languagecache); solv_free(pool->errstr); solv_free(pool->rootdir); @@ -1674,7 +1674,7 @@ pool_set_languages(Pool *pool, const char **languages, int nlanguages) pool->languagecacheother = 0; for (i = 0; i < pool->nlanguages; i++) free((char *)pool->languages[i]); - pool->languages = solv_free(pool->languages); + pool->languages = solv_free((void *)pool->languages); pool->nlanguages = nlanguages; if (!nlanguages) return; @@ -1922,7 +1922,7 @@ solver_fill_DU_cb(void *cbdata, Solvable *s, Repodata *data, Repokey *key, KeyVa cbd->mps[mp].kbytes += value->num; cbd->mps[mp].files += value->num2; } - else + else if (!(cbd->mps[mp].flags & DUCHANGES_ONLYADD)) { cbd->mps[mp].kbytes -= value->num; cbd->mps[mp].files -= value->num2; @@ -2030,13 +2030,17 @@ pool_calc_duchanges(Pool *pool, Map *installedmap, DUChanges *mps, int nmps) struct mptree *mptree; struct ducbdata cbd; Solvable *s; - int sp; + int i, sp; Map ignoredu; Repo *oldinstalled = pool->installed; + int haveonlyadd = 0; map_init(&ignoredu, 0); mptree = create_mptree(mps, nmps); + for (i = 0; i < nmps; i++) + if ((mps[i].flags & DUCHANGES_ONLYADD) != 0) + haveonlyadd = 1; cbd.mps = mps; cbd.dirmap = 0; cbd.nmap = 0; @@ -2054,21 +2058,55 @@ pool_calc_duchanges(Pool *pool, Map *installedmap, DUChanges *mps, int nmps) if (!cbd.hasdu && oldinstalled) { Id op, opp; + int didonlyadd = 0; /* no du data available, ignore data of all installed solvables we obsolete */ if (!ignoredu.size) map_grow(&ignoredu, oldinstalled->end - oldinstalled->start); + FOR_PROVIDES(op, opp, s->name) + { + Solvable *s2 = pool->solvables + op; + if (!pool->implicitobsoleteusesprovides && s->name != s2->name) + continue; + if (pool->implicitobsoleteusescolors && !pool_colormatch(pool, s, s2)) + continue; + if (op >= oldinstalled->start && op < oldinstalled->end) + { + MAPSET(&ignoredu, op - oldinstalled->start); + if (haveonlyadd && pool->solvables[op].repo == oldinstalled && !didonlyadd) + { + repo_search(oldinstalled, op, SOLVABLE_DISKUSAGE, 0, 0, solver_fill_DU_cb, &cbd); + cbd.addsub = -1; + repo_search(oldinstalled, op, SOLVABLE_DISKUSAGE, 0, 0, solver_fill_DU_cb, &cbd); + cbd.addsub = 1; + didonlyadd = 1; + } + } + } if (s->obsoletes) { Id obs, *obsp = s->repo->idarraydata + s->obsoletes; while ((obs = *obsp++) != 0) FOR_PROVIDES(op, opp, obs) - if (op >= oldinstalled->start && op < oldinstalled->end) - MAPSET(&ignoredu, op - oldinstalled->start); + { + Solvable *s2 = pool->solvables + op; + if (!pool->obsoleteusesprovides && !pool_match_nevr(pool, s2, obs)) + continue; + if (pool->obsoleteusescolors && !pool_colormatch(pool, s, s2)) + continue; + if (op >= oldinstalled->start && op < oldinstalled->end) + { + MAPSET(&ignoredu, op - oldinstalled->start); + if (haveonlyadd && pool->solvables[op].repo == oldinstalled && !didonlyadd) + { + repo_search(oldinstalled, op, SOLVABLE_DISKUSAGE, 0, 0, solver_fill_DU_cb, &cbd); + cbd.addsub = -1; + repo_search(oldinstalled, op, SOLVABLE_DISKUSAGE, 0, 0, solver_fill_DU_cb, &cbd); + cbd.addsub = 1; + didonlyadd = 1; + } + } + } } - FOR_PROVIDES(op, opp, s->name) - if (pool->solvables[op].name == s->name) - if (op >= oldinstalled->start && op < oldinstalled->end) - MAPSET(&ignoredu, op - oldinstalled->start); } } cbd.addsub = -1; |