From: Michael Schroeder Date: Mon, 18 Feb 2008 18:11:40 +0000 (+0000) Subject: - use SEARCH_NO_STORAGE_SOLVABLE instead of duplication code X-Git-Tag: BASE-SuSE-Code-12_1-Branch~897 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=535c2802d4684278e00f719c4895bc3f67593f13;p=platform%2Fupstream%2Flibsolv.git - use SEARCH_NO_STORAGE_SOLVABLE instead of duplication code - print rpmdbid, too --- diff --git a/tools/dumpsolv.c b/tools/dumpsolv.c index 37bed03..f10dc69 100644 --- a/tools/dumpsolv.c +++ b/tools/dumpsolv.c @@ -188,19 +188,7 @@ dump_repoattrs_cb(void *vcbdata, Solvable *s, Repodata *data, Repokey *key, KeyV void dump_repoattrs(Repo *repo, Id p) { - int i; - Repodata *data; - /* - * look through all repodata(s) to find the one covering the right range of Ids - */ - for (i = 0, data = repo->repodata; i < repo->nrepodata; i++, data++) - { - if (data->state == REPODATA_STUB || data->state == REPODATA_ERROR) /* skip repodata of wrong state */ - continue; - if (p < data->start || p >= data->end) /* skip repodata of wrong range */ - continue; - repodata_search(data, p - data->start, 0, dump_repoattrs_cb, 0); - } + repo_search(repo, p, 0, 0, SEARCH_NO_STORAGE_SOLVABLE, dump_repoattrs_cb, 0); } void @@ -312,6 +300,8 @@ int main(int argc, char **argv) printids(repo, "supplements", s->supplements); printids(repo, "enhances", s->enhances); printids(repo, "freshens", s->freshens); + if (repo->rpmdbid) + printf("rpmdbid: %u\n", repo->rpmdbid[i - repo->start]); #if 0 dump_attrs (repo, n - 1); #endif