Although we bumped yum-metadata-parser to 1.1.0 to create version 10
dbs, we never changed createrepo to reflect that in the metadata being
created.  This means that currently repos are being created with sqlite
dbs that are version 10, but the metadata says that they're version
9.[1]  Whoops.

So rather than just hardcode a different version, the attached adds
exporting of the dbversion to yum-metadata-parser and then using that
from createrepo.  Any concerns or does this look good to everyone?

Jeremy
--- createrepo-0.4.8/dumpMetadata.py.dbver	2007-05-15 12:13:48.000000000 -0400
+++ createrepo-0.4.8/dumpMetadata.py	2007-05-15 13:07:20.000000000 -0400
@@ -769,7 +769,10 @@
     repopath = os.path.join(cmds['outputdir'], cmds['tempdir'])
     
     if cmds['database']:
-        dbversion = '9'
+        if sqlitecachec.hasattr(DBVERSION):
+            dbversion = str(sqlitecachec.DBVERSION)
+        else:
+            dbversion = '9'
         rp = sqlitecachec.RepodataParserSqlite(repopath, repoid, None)
 
     for (file, ftype) in workfiles:
--- yum-metadata-parser-1.1.0/sqlitecachec.py.dbversion	2007-05-15 13:05:46.000000000 -0400
+++ yum-metadata-parser-1.1.0/sqlitecachec.py	2007-05-15 13:05:02.000000000 -0400
@@ -18,6 +18,8 @@
     import sqlite
 import _sqlitecache
 
+DBVERSION = _sqlitecache.DBVERSION
+
 class RepodataParserSqlite:
     def __init__(self, storedir, repoid, callback=None):
         self.callback = callback
--- yum-metadata-parser-1.1.0/sqlitecache.c.dbversion	2007-05-15 13:05:40.000000000 -0400
+++ yum-metadata-parser-1.1.0/sqlitecache.c	2007-05-15 13:04:43.000000000 -0400
@@ -609,5 +609,10 @@
 PyMODINIT_FUNC
 init_sqlitecache (void)
 {
-    Py_InitModule ("_sqlitecache", SqliteMethods);
+    PyObject * m, * d;
+
+    m = Py_InitModule ("_sqlitecache", SqliteMethods);
+
+    d = PyModule_GetDict(m);
+    PyDict_SetItemString(d, "DBVERSION", PyInt_FromLong(YUM_SQLITE_CACHE_DBVERSION));
 }
_______________________________________________
Yum-devel mailing list
[email protected]
https://lists.dulug.duke.edu/mailman/listinfo/yum-devel

Reply via email to