summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/fetch2/__init__.py')
-rw-r--r--bitbake/lib/bb/fetch2/__init__.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index ca0197e..a31e26b 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -806,12 +806,11 @@ class FetchMethod(object):
pd = persist_data.persist(d)
revs = pd['BB_URI_HEADREVS']
key = self.generate_revision_key(url, ud, d, name)
- rev = revs[key]
- if rev != None:
- return str(rev)
-
- revs[key] = rev = self._latest_revision(url, ud, d, name)
- return rev
+ try:
+ return revs[key]
+ except KeyError:
+ revs[key] = rev = self._latest_revision(url, ud, d, name)
+ return rev
def sortable_revision(self, url, ud, d, name):
"""
@@ -825,13 +824,13 @@ class FetchMethod(object):
key = self.generate_revision_key(url, ud, d, name)
latest_rev = self._build_revision(url, ud, d, name)
- last_rev = localcounts[key + '_rev']
+ last_rev = localcounts.get(key + '_rev')
uselocalcount = bb.data.getVar("BB_LOCALCOUNT_OVERRIDE", d, True) or False
count = None
if uselocalcount:
count = FetchMethod.localcount_internal_helper(ud, d, name)
if count is None:
- count = localcounts[key + '_count'] or "0"
+ count = localcounts.get(key + '_count') or "0"
if last_rev == latest_rev:
return str(count + "+" + latest_rev)
OpenPOWER on IntegriCloud