summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/fetch/__init__.py')
-rw-r--r--bitbake/lib/bb/fetch/__init__.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/bitbake/lib/bb/fetch/__init__.py b/bitbake/lib/bb/fetch/__init__.py
index 684e83d..95f0d9d 100644
--- a/bitbake/lib/bb/fetch/__init__.py
+++ b/bitbake/lib/bb/fetch/__init__.py
@@ -759,12 +759,11 @@ class Fetch(object):
pd = bb.persist_data.persist(d)
revs = pd['BB_URI_HEADREVS']
key = self.generate_revision_key(url, ud, d)
- rev = revs[key]
- if rev != None:
- return str(rev)
-
- revs[key] = rev = self._latest_revision(url, ud, d)
- return rev
+ try:
+ return revs[key]
+ except KeyError:
+ revs[key] = rev = self._latest_revision(url, ud, d)
+ return rev
def sortable_revision(self, url, ud, d):
"""
@@ -778,13 +777,13 @@ class Fetch(object):
key = self.generate_revision_key(url, ud, d)
latest_rev = self._build_revision(url, ud, d)
- 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 = Fetch.localcount_internal_helper(ud, d)
if count is None:
- count = localcounts[key + '_count']
+ count = localcounts.get(key + '_count')
if last_rev == latest_rev:
return str(count + "+" + latest_rev)
OpenPOWER on IntegriCloud