bitbake: Sync fetch back with upstream

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie 2011-05-06 18:18:59 +01:00
parent d2c925f8a9
commit 0cc52efc8c
1 changed files with 6 additions and 9 deletions

View File

@ -153,18 +153,18 @@ def fetcher_init(d):
Called to initialize the fetchers once the configuration data is known.
Calls before this must not hit the cache.
"""
pd = bb.persist_data.persist(d)
# 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":
logger.debug(1, "Keeping SRCREV cache due to cache policy of: %s", srcrev_policy)
elif srcrev_policy == "clear":
logger.debug(1, "Clearing SRCREV cache due to cache policy of: %s", srcrev_policy)
revs = persist_data.persist('BB_URI_HEADREVS', d)
try:
bb.fetch.saved_headrevs = pd['BB_URI_HEADREVS'].items()
bb.fetch.saved_headrevs = revs.items()
except:
pass
del pd['BB_URI_HEADREVS']
revs.clear()
else:
raise FetchError("Invalid SRCREV cache policy of: %s" % srcrev_policy)
@ -178,8 +178,7 @@ def fetcher_compare_revisions(d):
return true/false on whether they've changed.
"""
pd = bb.persist_data.persist(d)
data = pd['BB_URI_HEADREVS'].items()
data = persist_data.persist('BB_URI_HEADREVS', d).items()
data2 = bb.fetch.saved_headrevs
changed = False
@ -756,8 +755,7 @@ class Fetch(object):
if not hasattr(self, "_latest_revision"):
raise ParameterError
pd = bb.persist_data.persist(d)
revs = pd['BB_URI_HEADREVS']
revs = persist_data.persist('BB_URI_HEADREVS', d)
key = self.generate_revision_key(url, ud, d)
try:
return revs[key]
@ -772,8 +770,7 @@ class Fetch(object):
if hasattr(self, "_sortable_revision"):
return self._sortable_revision(url, ud, d)
pd = bb.persist_data.persist(d)
localcounts = pd['BB_URI_LOCALCOUNT']
localcounts = persist_data.persist('BB_URI_LOCALCOUNT', d)
key = self.generate_revision_key(url, ud, d)
latest_rev = self._build_revision(url, ud, d)