From: Michael Schroeder Date: Fri, 28 Aug 2015 13:40:44 +0000 (+0200) Subject: Support the meta datapos hack in dataiterator_init X-Git-Tag: 0.6.12~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad6a5d7a1af324587d22ddb0d717054d38ab1176;p=thirdparty%2Flibsolv.git Support the meta datapos hack in dataiterator_init A datapos with solvid SOLVID_META and no repodataid set means search all the repo's metadata. --- diff --git a/src/repodata.c b/src/repodata.c index 4ba1345b..c8542629 100644 --- a/src/repodata.c +++ b/src/repodata.c @@ -1927,19 +1927,19 @@ dataiterator_jump_to_solvid(Dataiterator *di, Id solvid) return; } di->repoid = 0; - di->data = di->repo->repodata + di->pool->pos.repodataid; - di->repodataid = 0; - di->solvid = solvid; - di->state = di_enterrepo; - di->flags |= SEARCH_THISSOLVID; - return; + if (!di->pool->pos.repodataid && di->pool->pos.solvid == SOLVID_META) { + solvid = SOLVID_META; /* META pos hack */ + } else { + di->data = di->repo->repodata + di->pool->pos.repodataid; + di->repodataid = 0; + } } - if (solvid > 0) + else if (solvid > 0) { di->repo = di->pool->solvables[solvid].repo; di->repoid = 0; } - else if (di->repoid > 0) + if (di->repoid > 0) { if (!di->pool->urepos) { @@ -1949,7 +1949,8 @@ dataiterator_jump_to_solvid(Dataiterator *di, Id solvid) di->repoid = 1; di->repo = di->pool->repos[di->repoid]; } - di->repodataid = 1; + if (solvid != SOLVID_POS) + di->repodataid = 1; di->solvid = solvid; if (solvid) di->flags |= SEARCH_THISSOLVID;