bitbake/fetch: Ensure SRCREVINACTION always resets the core flags even when parsing failes by using a try/finally

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
This commit is contained in:
Richard Purdie authored and Richard Purdie committed 2009-09-24 18:57:08 +01:00
1 parent 1bc5ed054e
commit 8138603680
2 files changed
+10 -6

No files matched your search

+5 -3
View File
@@ -351,9 +351,11 @@ class FetchData(object):
# if user sets localpath for file, use it instead.
self.localpath = self.parm["localpath"]
else:
bb.fetch.srcrev_internal_call = True
self.localpath = self.method.localpath(self.url, self, d)
bb.fetch.srcrev_internal_call = False
try:
bb.fetch.srcrev_internal_call = True
self.localpath = self.method.localpath(self.url, self, d)
finally:
bb.fetch.srcrev_internal_call = False
# We have to clear data's internal caches since the cached value of SRCREV is now wrong.
# Horrible...
bb.data.delVar("ISHOULDNEVEREXIST", d)
+5 -3
View File
@@ -357,9 +357,11 @@ class FetchData(object):
# if user sets localpath for file, use it instead.
self.localpath = self.parm["localpath"]
else:
bb.fetch.srcrev_internal_call = True
self.localpath = self.method.localpath(self.url, self, d)
bb.fetch.srcrev_internal_call = False
try:
bb.fetch.srcrev_internal_call = True
self.localpath = self.method.localpath(self.url, self, d)
finally:
bb.fetch.srcrev_internal_call = False
# We have to clear data's internal caches since the cached value of SRCREV is now wrong.
# Horrible...
bb.data.delVar("ISHOULDNEVEREXIST", d)