void
-rewrite_repos(Pool *pool, Queue *addedfileprovides)
+rewrite_repos(Pool *pool, Queue *addedfileprovides, Queue *addedfileprovides_inst)
{
Repo *repo;
Repodata *data;
continue; /* found a non-externsion repodata, can't rewrite */
if (repodata_lookup_idarray(data, SOLVID_META, REPOSITORY_ADDEDFILEPROVIDES, &fileprovidesq))
{
+ if (repo == pool->installed && addedfileprovides_inst)
+ {
+ for (j = 0; j < addedfileprovides->count; j++)
+ MAPCLR(&providedids, addedfileprovides->elements[j]);
+ for (j = 0; j < addedfileprovides_inst->count; j++)
+ MAPSET(&providedids, addedfileprovides_inst->elements[j]);
+ }
n = 0;
for (j = 0; j < fileprovidesq.count; j++)
if (MAPTST(&providedids, fileprovidesq.elements[j]))
n++;
- if (n == addedfileprovides->count)
+ if (repo == pool->installed && addedfileprovides_inst)
+ {
+ for (j = 0; j < addedfileprovides_inst->count; j++)
+ MAPCLR(&providedids, addedfileprovides_inst->elements[j]);
+ for (j = 0; j < addedfileprovides->count; j++)
+ MAPSET(&providedids, addedfileprovides->elements[j]);
+ if (n == addedfileprovides_inst->count)
+ continue; /* nothing new added */
+ }
+ else if (n == addedfileprovides->count)
continue; /* nothing new added */
}
- repodata_set_idarray(data, SOLVID_META, REPOSITORY_ADDEDFILEPROVIDES, addedfileprovides);
+ repodata_set_idarray(data, SOLVID_META, REPOSITORY_ADDEDFILEPROVIDES, repo == pool->installed && addedfileprovides_inst ? addedfileprovides_inst : addedfileprovides);
repodata_internalize(data);
cinfo = repo->appdata;
writecachedrepo(repo, data, 0, cinfo ? cinfo->cookie : installedcookie);
int allpkgs = 0;
FILE **newpkgsfps;
Queue addedfileprovides;
+ Queue addedfileprovides_inst;
Id repofilter = 0;
int cleandeps = 0;
// FOR_REPOS(i, repo)
// printf("%s: %d solvables\n", repo->name, repo->nsolvables);
queue_init(&addedfileprovides);
- pool_addfileprovides_queue(pool, &addedfileprovides);
- if (addedfileprovides.count)
- rewrite_repos(pool, &addedfileprovides);
+ queue_init(&addedfileprovides_inst);
+ pool_addfileprovides_queue(pool, &addedfileprovides, &addedfileprovides_inst);
+ if (addedfileprovides.count || addedfileprovides_inst.count)
+ rewrite_repos(pool, &addedfileprovides, &addedfileprovides_inst);
queue_free(&addedfileprovides);
+ queue_free(&addedfileprovides_inst);
pool_createwhatprovides(pool);
queue_init(&job);
}
void
-pool_addfileprovides_queue(Pool *pool, Queue *idq)
+pool_addfileprovides_queue(Pool *pool, Queue *idq, Queue *idqinst)
{
Solvable *s;
Repo *installed, *repo;
if (idq)
queue_empty(idq);
+ if (idqinst)
+ queue_empty(idqinst);
isfp = installed ? &isf : 0;
for (i = 1, s = pool->solvables + i; i < pool->nsolvables; i++, s++)
{
if (idq)
for (i = 0; i < sf.nfiles; i++)
queue_push(idq, sf.ids[i]);
+ if (idqinst)
+ for (i = 0; i < sf.nfiles; i++)
+ queue_push(idqinst, sf.ids[i]);
solv_free(sf.ids);
for (i = 0; i < sf.nfiles; i++)
{
#endif
if (installed)
pool_addfileprovides_search(pool, &cbd, &isf, installed);
+ if (installed && idqinst)
+ for (i = 0; i < isf.nfiles; i++)
+ queue_pushunique(idqinst, isf.ids[i]);
solv_free(isf.ids);
for (i = 0; i < isf.nfiles; i++)
{
void
pool_addfileprovides(Pool *pool)
{
- pool_addfileprovides_queue(pool, 0);
+ pool_addfileprovides_queue(pool, 0, 0);
}
void
info = repo_add_repodata(repo, 0);
repodata_set_str(info, SOLVID_META, REPOSITORY_TOOLVERSION, LIBSOLV_TOOLVERSION);
queue_init(&addedfileprovides);
- pool_addfileprovides_queue(repo->pool, &addedfileprovides);
+ pool_addfileprovides_queue(repo->pool, &addedfileprovides, 0);
if (addedfileprovides.count)
{
kd.haveaddedfileprovides = 1;