1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-02 13:29:49 +00:00

persist_data: raise KeyError on missing elements

(Bitbake rev: a4f62433845c29f98c6a9746d5d2847bf9506ea5)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Chris Larson
2011-04-04 09:36:10 -07:00
committed by Richard Purdie
parent fc801b9073
commit 7fc020aa15
4 changed files with 27 additions and 24 deletions
+7 -8
View File
@@ -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)