From: Michael Schroeder Date: Mon, 4 Feb 2013 16:34:33 +0000 (+0100) Subject: do not call pool_freewhatprovides in pool_add_fileconflicts_deps X-Git-Tag: BASE-SuSE-Code-12_3-Branch~95 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2bd102f701f4f018a2971c9e058538280785f24d;p=thirdparty%2Flibsolv.git do not call pool_freewhatprovides in pool_add_fileconflicts_deps There may be precious job data in the whatprovides area. --- diff --git a/src/pool.c b/src/pool.c index 67f9d489..b65a1c21 100644 --- a/src/pool.c +++ b/src/pool.c @@ -2098,6 +2098,39 @@ pool_lookup_deltalocation(Pool *pool, Id entry, unsigned int *medianrp) return loc; } +static void +add_new_provider(Pool *pool, Id id, Id p) +{ + Queue q; + Id *pp; + + while (ISRELDEP(id)) + { + Reldep *rd = GETRELDEP(pool, id); + id = rd->name; + } + + queue_init(&q); + for (pp = pool->whatprovidesdata + pool->whatprovides[id]; *pp; pp++) + { + if (*pp == p) + { + queue_free(&q); + return; + } + if (*pp > p) + { + queue_push(&q, p); + p = 0; + } + queue_push(&q, *pp); + } + if (p) + queue_push(&q, p); + pool->whatprovides[id] = pool_queuetowhatprovides(pool, &q); + queue_free(&q); +} + void pool_add_fileconflicts_deps(Pool *pool, Queue *conflicts) { @@ -2109,7 +2142,6 @@ pool_add_fileconflicts_deps(Pool *pool, Queue *conflicts) if (!conflicts->count) return; - pool_freewhatprovides(pool); for (i = 0; i < conflicts->count; i += 5) { fn = conflicts->elements[i]; @@ -2121,6 +2153,10 @@ pool_add_fileconflicts_deps(Pool *pool, Queue *conflicts) if (!s->repo) continue; s->provides = repo_addid_dep(s->repo, s->provides, id, SOLVABLE_FILEMARKER); + if (pool->whatprovides) + add_new_provider(pool, fn, p); + if (pool->whatprovides_rel) + pool->whatprovides_rel[GETRELID(id)] = 0; /* clear cache */ s = pool->solvables + q; if (!s->repo) continue;