Hi All,

I posted this on the Angstrom mailing, but thought I would post here. 
It's a simple change to allow 1.8.8 or later work with sqlite2:

The 1.8.8 bitbake uses sqlite to keep some persistent store, but it does 
not work with sqlite2 - it uses DROP TABLE IF EXISTS and CREATE TABLE 
IF NOT EXISTS, which were only added with sqlite3

This fixes it for me, and will work with sqlite3, but I'm not much of an 
sql or python man!

Index: lib/bb/persist_data.py
===================================================================
--- lib/bb/persist_data.py      (revision 973)
+++ lib/bb/persist_data.py      (working copy)
@@ -57,13 +57,19 @@
         Should be called before any domain is used
         Creates it if it doesn't exist.
         """
-        self.connection.execute("CREATE TABLE IF NOT EXISTS %s(key 
TEXT, value TEXT);" % domain)
+        try:
+            self.connection.execute("CREATE TABLE %s(key TEXT, value 
TEXT);" % domain)
+        except:
+           bb.msg.debug(1, bb.msg.domain.PersistData, "Create 
table '%s' failed" % domain)

     def delDomain(self, domain):
         """
         Removes a domain and all the data it contains
         """
-        self.connection.execute("DROP TABLE IF EXISTS %s;" % domain)
+       try:
+            self.connection.execute("DROP TABLE %s;" % domain)
+        except:
+           bb.msg.debug(1, bb.msg.domain.PersistData, "Delete 
table '%s' failed" % domain)

     def getValue(self, domain, key):
         """

Thanks,
Tim

_______________________________________________
Bitbake-dev mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/bitbake-dev

Reply via email to