diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2016-01-26 15:34:31 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-02-18 07:40:58 +0000 |
commit | 2602a312818f564961de7dfa63c429d45ff9e5ac (patch) | |
tree | 7cbf136bbd86051259c12e43b43200b687687b93 /lib/bb/cache.py | |
parent | 4f60933283f377d68f191db849dac6c1dc7a0aed (diff) | |
download | openembedded-core-contrib-2602a312818f564961de7dfa63c429d45ff9e5ac.tar.gz |
MultiProcessCache: make cache filename configurable
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>
Diffstat (limited to 'lib/bb/cache.py')
-rw-r--r-- | lib/bb/cache.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/bb/cache.py b/lib/bb/cache.py index 55283b03d6..063ab15e1b 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") |