diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2007-07-29 21:36:39 +0000 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2007-07-29 21:36:39 +0000 |
commit | 89bbfe40b9ae3c4cb7ebefcdbde6fe0b6f981e38 (patch) | |
tree | e568eb1f39dd82c301eb15694fc56bd41a24ab6f /lib/bb/persist_data.py | |
parent | 1cbe52b9b6d15b6c8878fa8c3aac06c804dc6be2 (diff) | |
download | bitbake-contrib-89bbfe40b9ae3c4cb7ebefcdbde6fe0b6f981e38.tar.gz |
persist_data.py: Try harder to import an sqlite package. Show how to change the connection lock timeout
Diffstat (limited to 'lib/bb/persist_data.py')
-rw-r--r-- | lib/bb/persist_data.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/bb/persist_data.py b/lib/bb/persist_data.py index b00afe650..4df335a6a 100644 --- a/lib/bb/persist_data.py +++ b/lib/bb/persist_data.py @@ -20,7 +20,10 @@ import bb, os try: import sqlite3 except ImportError: - bb.msg.fatal(bb.msg.domain.PersistData, "Importing sqlite3 failed, please install it.") + try: + from pysqlite2 import dbapi2 as sqlite3 + except ImportError: + bb.msg.fatal(bb.msg.domain.PersistData, "Importing sqlite3 and pysqlite2 failed, please install one of them. A 'python-pysqlite2' like package is likely to be what you need.") class PersistData: """ @@ -47,7 +50,7 @@ class PersistData: self.cachefile = os.path.join(self.cachedir,"bb_persist_data.sqlite3") bb.msg.debug(1, bb.msg.domain.PersistData, "Using '%s' as the persistent data cache" % self.cachefile) - self.connection = sqlite3.connect(self.cachefile, isolation_level=None) + self.connection = sqlite3.connect(self.cachefile, timeout=5, isolation_level=None) def addDomain(self, domain): """ |