Work around the schema problem for now without changing the SOLV format.
authorMichael Matz <matz@suse.de>
Fri, 7 Dec 2007 21:43:39 +0000 (21:43 +0000)
committerMichael Matz <matz@suse.de>
Fri, 7 Dec 2007 21:43:39 +0000 (21:43 +0000)
The Repo writer doesn't account the the zero element at schemadata[0],
and starts counting schemas with 0, the attr store reserves schema ID 0
for the empty schema.  So the attr store explicitely needs to store that
too, otherwise the repo reader will be confused.

tools/attr_store.c

index 437f5d7..b5a0a7c 100644 (file)
@@ -897,9 +897,9 @@ write_attr_store (FILE *fp, Attrstore *s)
       s->keys[i].name = str2id (s->pool, localid2str (s, s->keys[i].name), 0);
     }
 
-  write_id (fp, s->szschemata - 1);
-  Id *ids = s->schemata + 1;
-  for (i = 1; i < s->nschemata; i++)
+  write_id (fp, s->szschemata);
+  Id *ids = s->schemata + 0;
+  for (i = 0; i < s->nschemata; i++)
     ids = write_idarray (fp, ids);
   assert (ids == s->schemata + s->szschemata);