aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/fetch/__init__.py
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2010-06-04 14:04:41 +0200
committerChris Larson <chris_larson@mentor.com>2010-06-04 16:27:49 -0700
commit8a6876752b90efd81d92f0947bfc9527d8260969 (patch)
tree407e7935cf8af1404ab0fb353fb230d4523b5f5d /lib/bb/fetch/__init__.py
parentf7c69462b8ba726861898817cc5b13174c78e35a (diff)
downloadbitbake-8a6876752b90efd81d92f0947bfc9527d8260969.tar.gz
persist_data: cache connection and use cursor
Store database connection to persistent database in fetcher. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Signed-off-by: Chris Larson <chris_larson@mentor.com>
Diffstat (limited to 'lib/bb/fetch/__init__.py')
-rw-r--r--lib/bb/fetch/__init__.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/bb/fetch/__init__.py b/lib/bb/fetch/__init__.py
index 5fbacc73d..cf26dc158 100644
--- a/lib/bb/fetch/__init__.py
+++ b/lib/bb/fetch/__init__.py
@@ -146,13 +146,14 @@ def uri_replace(uri, uri_find, uri_replace, d):
methods = []
urldata_cache = {}
saved_headrevs = {}
+persistent_database_connection = {}
def fetcher_init(d):
"""
Called to initialize the fetchers once the configuration data is known.
Calls before this must not hit the cache.
"""
- pd = persist_data.PersistData(d)
+ pd = persist_data.PersistData(d, persistent_database_connection)
# When to drop SCM head revisions controlled by user policy
srcrev_policy = bb.data.getVar('BB_SRCREV_POLICY', d, 1) or "clear"
if srcrev_policy == "cache":
@@ -181,7 +182,7 @@ def fetcher_compare_revisons(d):
return true/false on whether they've changed.
"""
- pd = persist_data.PersistData(d)
+ pd = persist_data.PersistData(d, persistent_database_connection)
data = pd.getKeyValues("BB_URI_HEADREVS")
data2 = bb.fetch.saved_headrevs
@@ -673,7 +674,7 @@ class Fetch(object):
if not hasattr(self, "_latest_revision"):
raise ParameterError
- pd = persist_data.PersistData(d)
+ pd = persist_data.PersistData(d, persistent_database_connection)
key = self.generate_revision_key(url, ud, d)
rev = pd.getValue("BB_URI_HEADREVS", key)
if rev != None:
@@ -690,7 +691,7 @@ class Fetch(object):
if hasattr(self, "_sortable_revision"):
return self._sortable_revision(url, ud, d)
- pd = persist_data.PersistData(d)
+ pd = persist_data.PersistData(d, persistent_database_connection)
key = self.generate_revision_key(url, ud, d)
latest_rev = self._build_revision(url, ud, d)