bitbake: cache: Don't reload the cache file since we already have this data in memory
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 25 Jul 2014 13:50:43 +0000 (14:50 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 26 Jul 2014 07:50:13 +0000 (08:50 +0100)
If we're writing out merged data to disk, its safe to assume that either
we loaded the data or couldn't. Loading it again is relatively pointless
and time consuming.

(Bitbake rev: 14c31e18e4a4a52ee54056aeefb09ff8c295b475)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/bb/cache.py

index 936829b..6dedd4d 100644 (file)
@@ -814,15 +814,7 @@ class MultiProcessCache(object):
 
         glf = bb.utils.lockfile(self.cachefile + ".lock")
 
-        try:
-            with open(self.cachefile, "rb") as f:
-                p = pickle.Unpickler(f)
-                data, version = p.load()
-        except (IOError, EOFError):
-            data, version = None, None
-
-        if version != self.__class__.CACHE_VERSION:
-            data = self.create_cachedata()
+        data = self.cachedata
 
         for f in [y for y in os.listdir(os.path.dirname(self.cachefile)) if y.startswith(os.path.basename(self.cachefile) + '-')]:
             f = os.path.join(os.path.dirname(self.cachefile), f)