From a05435fc59d32f2fcf4ea4185cb0655eeb343211 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Fri, 25 Jul 2014 14:52:19 +0100 Subject: bitbake: cache: Optimise invalid cache file handling If there is a corrupt/invalid cache file, we'd keep trying to reopen it. This is pointless, simplify the code paths and delete the dead file. (Bitbake rev: c22441f7025be012ad2e62a51ccb993c3a0e16c9) Signed-off-by: Richard Purdie --- bitbake/lib/bb/cache.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bitbake/lib') diff --git a/bitbake/lib/bb/cache.py b/bitbake/lib/bb/cache.py index 6dedd4d595..c7f3b7ab71 100644 --- a/bitbake/lib/bb/cache.py +++ b/bitbake/lib/bb/cache.py @@ -823,9 +823,11 @@ class MultiProcessCache(object): p = pickle.Unpickler(fd) extradata, version = p.load() except (IOError, EOFError): - extradata, version = self.create_cachedata(), None + os.unlink(f) + continue if version != self.__class__.CACHE_VERSION: + os.unlink(f) continue self.merge_data(extradata, data) -- cgit 1.2.3-korg