]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
MultiProcessCache: make cache filename configurable
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Tue, 26 Jan 2016 13:34:31 +0000 (15:34 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 18 Feb 2016 07:40:58 +0000 (07:40 +0000)
If no cache file name is given a default from class variable is used,
like before.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/cache.py

index 55283b03d6ce1c3bee6ca421f4d024b590b12722..063ab15e1b39c38d3f3f0c971507ba3c89a38cc5 100644 (file)
@@ -755,13 +755,14 @@ class MultiProcessCache(object):
         self.cachedata = self.create_cachedata()
         self.cachedata_extras = self.create_cachedata()
 
-    def init_cache(self, d):
+    def init_cache(self, d, cache_file_name=None):
         cachedir = (d.getVar("PERSISTENT_DIR", True) or
                     d.getVar("CACHE", True))
         if cachedir in [None, '']:
             return
         bb.utils.mkdirhier(cachedir)
-        self.cachefile = os.path.join(cachedir, self.__class__.cache_file_name)
+        self.cachefile = os.path.join(cachedir,
+                                      cache_file_name or self.__class__.cache_file_name)
         logger.debug(1, "Using cache in '%s'", self.cachefile)
 
         glf = bb.utils.lockfile(self.cachefile + ".lock")