{
Repodata *sdata;
int i;
- for (i = 0, sdata = repo->repodata; i < repo->nrepodata; i++, sdata++)
+
+ FOR_REPODATAS(repo, i, sdata)
{
int p;
if (!repodata_has_keyname(sdata, SUSETAGS_SHARE_NAME))
/* start with all KEY_STORAGE_SOLVABLE ids */
n = ID_NUM_INTERNAL;
- for (i = 0; i < repo->nrepodata; i++)
- n += repo->repodata[i].nkeys;
+ FOR_REPODATAS(repo, i, data)
+ n += data->nkeys;
cbdata.keymap = sat_calloc(n, sizeof(Id));
cbdata.keymapstart = sat_calloc(repo->nrepodata, sizeof(Id));
repodataused = sat_calloc(repo->nrepodata, 1);
dirpool = 0;
dirpooldata = 0;
n = ID_NUM_INTERNAL;
- for (i = 0; i < repo->nrepodata; i++)
+ FOR_REPODATAS(repo, i, data)
{
- data = repo->repodata + i;
cbdata.keymapstart[i] = n;
cbdata.keymap[n++] = 0; /* key 0 */
idused = 0;
cbdata.sp = cbdata.schema;
/* collect all other data from all repodatas */
/* XXX: merge arrays of equal keys? */
- for (j = 0, data = repo->repodata; j < repo->nrepodata; j++, data++)
+ FOR_REPODATAS(repo, j, data)
{
if (!repodataused[j])
continue;
if (anyrepodataused)
{
- for (j = 0, data = repo->repodata; j < repo->nrepodata; j++, data++)
+ FOR_REPODATAS(repo, j, data)
{
if (!repodataused[j])
continue;
data_addid(xd, mainschema);
#if 1
- for (j = 0, data = repo->repodata; j < repo->nrepodata; j++, data++)
+ FOR_REPODATAS(repo, j, data)
{
if (!repodataused[j])
continue;
if (anyrepodataused)
{
cbdata.vstart = -1;
- for (j = 0, data = repo->repodata; j < repo->nrepodata; j++, data++)
+ FOR_REPODATAS(repo, j, data)
{
if (!repodataused[j])
continue;
continue;
}
ndone = 0;
- for (data = repo->repodata, repodataid = 0; repodataid < repo->nrepodata; repodataid++, data++)
+ FOR_REPODATAS(repo, repodataid, data)
{
if (ndone >= repo->nsolvables)
break;
Hashmask relhashmask;
struct _Repo **repos;
- int nrepos;
+ int nrepos; /* repos allocated */
struct _Repo *installed; /* packages considered installed */
Solvable *solvables;
- int nsolvables;
+ int nsolvables; /* solvables allocated */
const char **languages;
int nlanguages;
for (s = repo->pool->solvables + start, i = count; i--; s++)
s->repo = 0;
pool_free_solvable_block(repo->pool, start, count, reuseids);
- for (i = 0, data = repo->repodata; i < repo->nrepodata; i++, data++)
+ FOR_REPODATAS(repo, i, data)
if (data->end > repo->end)
repodata_shrink(data, repo->end);
}
}
}
- for (i = 0, data = repo->repodata; i < repo->nrepodata; i++, data++)
+ FOR_REPODATAS(repo, i, data)
{
if (p < data->start || p >= data->end)
continue;
return pool_id2str(pool, pool->solvables[entry].vendor);
}
}
- for (i = 0, data = repo->repodata; i < repo->nrepodata; i++, data++)
+ FOR_REPODATAS(repo, i, data)
{
if (entry != SOLVID_META && (entry < data->start || entry >= data->end))
continue;
return notfound;
}
}
- for (i = 0, data = repo->repodata; i < repo->nrepodata; i++, data++)
+ FOR_REPODATAS(repo, i, data)
{
if (entry != SOLVID_META && (entry < data->start || entry >= data->end))
continue;
return repo->pool->solvables[entry].vendor;
}
}
- for (i = 0, data = repo->repodata; i < repo->nrepodata; i++, data++)
+ FOR_REPODATAS(repo, i, data)
{
if (entry != SOLVID_META && (entry < data->start || entry >= data->end))
continue;
return lookup_idarray_solvable(repo, repo->pool->solvables[entry].enhances, q);
}
}
- for (i = 0, data = repo->repodata; i < repo->nrepodata; i++, data++)
+ FOR_REPODATAS(repo, i, data)
{
if (entry != SOLVID_META && (entry < data->start || entry >= data->end))
continue;
int i;
const unsigned char *chk;
- for (i = 0, data = repo->repodata; i < repo->nrepodata; i++, data++)
+ FOR_REPODATAS(repo, i, data)
{
if (entry != SOLVID_META && (entry < data->start || entry >= data->end))
continue;
int i;
Id type;
- for (i = 0, data = repo->repodata; i < repo->nrepodata; i++, data++)
+ FOR_REPODATAS(repo, i, data)
{
if (entry != SOLVID_META && (entry < data->start || entry >= data->end))
continue;
int i;
Id type;
- for (i = 0, data = repo->repodata; i < repo->nrepodata; i++, data++)
+ FOR_REPODATAS(repo, i, data)
{
if (entry != SOLVID_META && (entry < data->start || entry >= data->end))
continue;
int i;
Repodata *data;
- for (i = 0, data = repo->repodata; i < repo->nrepodata; i++, data++)
+ FOR_REPODATAS(repo, i, data)
if (data->attrs || data->xattrs)
repodata_internalize(data);
}
int i;
Repodata *data;
- for (i = 0, data = repo->repodata; i < repo->nrepodata; i++, data++)
+ FOR_REPODATAS(repo, i, data)
repodata_disable_paging(data);
}
// EOF
void repo_internalize(Repo *repo);
void repo_disable_paging(Repo *repo);
+#define FOR_REPODATAS(repo, rdid, data) \
+ for (rdid = 0, data = repo->repodata + rdid; rdid < repo->nrepodata; rdid++, data++)
+
#endif /* LIBSOLV_REPO_H */
int has_FL = 0;
/* find languages and other info */
- for (i = 0, data = repo->repodata; i < repo->nrepodata; i++, data++)
+ FOR_REPODATAS(repo, i, data)
{
for (j = 1, key = data->keys + j; j < data->nkeys; j++, key++)
{
if (repo->nrepodata == 0)
return;
printf("repo contains %d repodata sections:\n", repo->nrepodata);
- for (i = 0, data = repo->repodata; i < repo->nrepodata; i++, data++)
+ FOR_REPODATAS(repo, i, data)
{
unsigned int j;
printf("\nrepodata %d has %d keys, %d schemata\n", i + 1, data->nkeys - 1, data->nschemata - 1);
for (i = j = 0; i < cand.count; i++)
{
p = cand.elements[i];
- if (solv->decisionmap[p] <= 0)
+ if (solver_get_decisionlevel(solv, p) <= 0)
{
cand.elements[j++] = p;
continue;
toinst(Solver *solv, Repo *repo, Repo *instrepo)
{
Pool *pool = solv->pool;
+ Queue q;
int k;
Id p;
- for (k = 0; k < solv->decisionq.count; k++)
+ queue_init(&q);
+ solver_get_decisionqueue(solv, &q);
+ for (k = 0; k < q.count; k++)
{
- p = solv->decisionq.elements[k];
+ p = q.elements[k];
if (p < 0 || p == SYSTEMSOLVABLE)
continue;
/* oh my! */
pool->solvables[p].repo = instrepo;
}
+ queue_free(&q);
}
void
for (i = 0; i < cand.count; i++)
{
p = cand.elements[i];
- if (p > 0 && solv->decisionmap[p] > 0)
+ if (p > 0 && solver_get_decisionlevel(solv, p) > 0)
cand.elements[i] = -p; /* drop candidate */
}
solver_free(solv);