summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2011-04-04 09:36:45 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-05-06 18:05:11 +0100
commit754d1c69839982b7cdd49839a398e688c0ad9a9b (patch)
treee848f86280222186e0cb7311afe2e55024192dd0 /bitbake/lib/bb/fetch2
parent824acff967ff74c0a678bf8accc4a514653f5783 (diff)
downloadpoky-754d1c69839982b7cdd49839a398e688c0ad9a9b.tar.gz
persist_data: implement comparison, same as dict
(Bitbake rev: 1190406c526c7bb7cf415867be83e0403812a7dd) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2')
-rw-r--r--bitbake/lib/bb/fetch2/__init__.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index a31e26bf75..27fcc3cf76 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -222,18 +222,18 @@ def fetcher_init(d):
222 Called to initialize the fetchers once the configuration data is known. 222 Called to initialize the fetchers once the configuration data is known.
223 Calls before this must not hit the cache. 223 Calls before this must not hit the cache.
224 """ 224 """
225 pd = persist_data.persist(d)
226 # When to drop SCM head revisions controlled by user policy 225 # When to drop SCM head revisions controlled by user policy
227 srcrev_policy = bb.data.getVar('BB_SRCREV_POLICY', d, True) or "clear" 226 srcrev_policy = bb.data.getVar('BB_SRCREV_POLICY', d, True) or "clear"
228 if srcrev_policy == "cache": 227 if srcrev_policy == "cache":
229 logger.debug(1, "Keeping SRCREV cache due to cache policy of: %s", srcrev_policy) 228 logger.debug(1, "Keeping SRCREV cache due to cache policy of: %s", srcrev_policy)
230 elif srcrev_policy == "clear": 229 elif srcrev_policy == "clear":
231 logger.debug(1, "Clearing SRCREV cache due to cache policy of: %s", srcrev_policy) 230 logger.debug(1, "Clearing SRCREV cache due to cache policy of: %s", srcrev_policy)
231 revs = bb.persist_data.persist('BB_URI_HEADREVS', d)
232 try: 232 try:
233 bb.fetch2.saved_headrevs = pd['BB_URI_HEADREVS'].items() 233 bb.fetch2.saved_headrevs = revs.items()
234 except: 234 except:
235 pass 235 pass
236 del pd['BB_URI_HEADREVS'] 236 revs.clear()
237 else: 237 else:
238 raise FetchError("Invalid SRCREV cache policy of: %s" % srcrev_policy) 238 raise FetchError("Invalid SRCREV cache policy of: %s" % srcrev_policy)
239 239
@@ -247,8 +247,7 @@ def fetcher_compare_revisions(d):
247 return true/false on whether they've changed. 247 return true/false on whether they've changed.
248 """ 248 """
249 249
250 pd = persist_data.persist(d) 250 data = bb.persist_data.persist('BB_URI_HEADREVS', d).items()
251 data = pd['BB_URI_HEADREVS'].items()
252 data2 = bb.fetch2.saved_headrevs 251 data2 = bb.fetch2.saved_headrevs
253 252
254 changed = False 253 changed = False
@@ -803,8 +802,7 @@ class FetchMethod(object):
803 if not hasattr(self, "_latest_revision"): 802 if not hasattr(self, "_latest_revision"):
804 raise ParameterError("The fetcher for this URL does not support _latest_revision", url) 803 raise ParameterError("The fetcher for this URL does not support _latest_revision", url)
805 804
806 pd = persist_data.persist(d) 805 revs = bb.persist_data.persist('BB_URI_HEADREVS', d)
807 revs = pd['BB_URI_HEADREVS']
808 key = self.generate_revision_key(url, ud, d, name) 806 key = self.generate_revision_key(url, ud, d, name)
809 try: 807 try:
810 return revs[key] 808 return revs[key]
@@ -819,8 +817,7 @@ class FetchMethod(object):
819 if hasattr(self, "_sortable_revision"): 817 if hasattr(self, "_sortable_revision"):
820 return self._sortable_revision(url, ud, d) 818 return self._sortable_revision(url, ud, d)
821 819
822 pd = persist_data.persist(d) 820 localcounts = bb.persist_data.persist('BB_URI_LOCALCOUNT', d)
823 localcounts = pd['BB_URI_LOCALCOUNT']
824 key = self.generate_revision_key(url, ud, d, name) 821 key = self.generate_revision_key(url, ud, d, name)
825 822
826 latest_rev = self._build_revision(url, ud, d, name) 823 latest_rev = self._build_revision(url, ud, d, name)