dataiterator_set_search(Dataiterator *di, Repo *repo, Id p)
{
di->repo = repo;
- di->repoid = -1;
+ di->repoid = 0;
di->flags &= ~SEARCH_THISSOLVID;
di->nparents = 0;
di->rootlevel = 0;
}
if (!repo)
{
- di->repoid = 0;
+ di->repoid = 1;
di->repo = di->pool->repos[0];
}
di->state = di_enterrepo;
/* FALLTHROUGH */
case di_nextrepo: di_nextrepo:
- if (di->repoid >= 0)
+ if (di->repoid > 0)
{
di->repoid++;
di->repodataid = 0;
- if (di->repoid < di->pool->nrepos)
+ if (di->repoid - 1 < di->pool->nrepos)
{
- di->repo = di->pool->repos[di->repoid];
+ di->repo = di->pool->repos[di->repoid - 1];
goto di_enterrepo;
}
}
di->state = di_bye;
return;
}
- di->repoid = -1;
+ di->repoid = 0;
di->data = di->repo->repodata + di->pool->pos.repodataid;
di->repodataid = -1;
di->solvid = solvid;
if (solvid > 0)
{
di->repo = di->pool->solvables[solvid].repo;
- di->repoid = -1;
+ di->repoid = 0;
}
- else if (di->repoid >= 0)
+ else if (di->repoid > 0)
{
if (!di->pool->nrepos)
{
di->state = di_bye;
return;
}
+ di->repoid = 1;
di->repo = di->pool->repos[0];
- di->repoid = 0;
}
di->repodataid = 0;
di->solvid = solvid;
di->kv.parent = 0;
di->rootlevel = 0;
di->repo = repo;
- di->repoid = -1;
+ di->repoid = 0; /* 0 means stay at repo */
di->repodataid = 0;
di->solvid = 0;
di->flags &= ~SEARCH_THISSOLVID;