From 23602c1056a784a72f3eeb72ff9ad2381bd338cf Mon Sep 17 00:00:00 2001 From: Michael Schroeder Date: Mon, 13 Oct 2008 13:32:08 +0000 Subject: [PATCH] - fix order of schema creation --- tools/repo_write.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/tools/repo_write.c b/tools/repo_write.c index 0e4165f..107a166 100644 --- a/tools/repo_write.c +++ b/tools/repo_write.c @@ -1255,6 +1255,23 @@ for (i = 1; i < cbdata.nmykeys; i++) cbdata.extraschemata = sat_calloc(repo->nextra, sizeof(Id)); #endif + /* create main schema */ + 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++) + repodata_search(data, SOLVID_META, 0, repo_write_cb_needed, &cbdata); + sp = cbdata.sp; + /* add solvables if needed */ + if (repo->nsolvables) + { + *sp++ = cbdata.keymap[REPOSITORY_SOLVABLES]; + cbdata.mykeys[cbdata.keymap[REPOSITORY_SOLVABLES]].size++; + } + *sp = 0; + mainschema = addschema(&cbdata, cbdata.schema); + + idarraydata = repo->idarraydata; cbdata.doingsolvables = 1; @@ -1351,22 +1368,6 @@ for (i = 1; i < cbdata.nmykeys; i++) cbdata.doingsolvables = 0; assert(n == repo->nsolvables); - /* create main schema */ - 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++) - repodata_search(data, SOLVID_META, 0, repo_write_cb_needed, &cbdata); - sp = cbdata.sp; - /* add solvables if needed */ - if (repo->nsolvables) - { - *sp++ = cbdata.keymap[REPOSITORY_SOLVABLES]; - cbdata.mykeys[cbdata.keymap[REPOSITORY_SOLVABLES]].size++; - } - *sp = 0; - mainschema = addschema(&cbdata, cbdata.schema); - #if 0 if (repo->nextra && anyrepodataused) for (i = -1; i >= -repo->nextra; i--) -- 2.7.4