[bitbake-devel] [PATCH 5/6] MultiProcessCache: make cache filename configurable

Markus Lehtonen markus.lehtonen at linux.intel.com
Tue Jan 26 13:34:31 UTC 2016


If no cache file name is given a default from class variable is used,
like before.

Signed-off-by: Markus Lehtonen <markus.lehtonen at linux.intel.com>
---
 lib/bb/cache.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/bb/cache.py b/lib/bb/cache.py
index 55283b0..063ab15 100644
--- a/lib/bb/cache.py
+++ b/lib/bb/cache.py
@@ -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")
-- 
2.1.4




More information about the bitbake-devel mailing list