From 6baea3d6bf0aeef627b70401eb44d9538f63e6d6 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Sat, 17 Oct 2009 19:48:34 +0100 Subject: fetch/__init__.py: Fix a bug where errors could corrupt bitbake internal state wrt SRCREVINACTION (from Poky) Signed-off-by: Richard Purdie --- lib/bb/fetch/__init__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/bb/fetch/__init__.py b/lib/bb/fetch/__init__.py index 16c3a961a..7bacb2ceb 100644 --- a/lib/bb/fetch/__init__.py +++ b/lib/bb/fetch/__init__.py @@ -333,9 +333,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) -- cgit 1.2.3-korg