- fix order of schema creation
authorMichael Schroeder <mls@suse.de>
Mon, 13 Oct 2008 13:32:08 +0000 (13:32 +0000)
committerMichael Schroeder <mls@suse.de>
Mon, 13 Oct 2008 13:32:08 +0000 (13:32 +0000)
tools/repo_write.c

index 0e4165f..107a166 100644 (file)
@@ -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--)