diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2016-01-26 15:34:32 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-02-18 07:40:58 +0000 |
commit | a965b390d6240e279c190b92b17c0573e9bd604c (patch) | |
tree | 0de37c99b6d8c81abf86ad2aac72df9e7d5051e6 /lib | |
parent | 2602a312818f564961de7dfa63c429d45ff9e5ac (diff) | |
download | bitbake-a965b390d6240e279c190b92b17c0573e9bd604c.tar.gz |
SignatureGeneratorBasic: make checksum cache file configurable
Define a new bitbake configuration variable BB_HASH_CHECKSUM_CACHE_FILE
that can be used to define the cache file to use for file checksum
cache.
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bb/siggen.py | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/lib/bb/siggen.py b/lib/bb/siggen.py index a7916b29b..43cf7b6e5 100644 --- a/lib/bb/siggen.py +++ b/lib/bb/siggen.py @@ -4,6 +4,7 @@ import os import re import tempfile import bb.data +from bb.checksum import FileChecksumCache logger = logging.getLogger('BitBake.SigGen') @@ -91,6 +92,12 @@ class SignatureGeneratorBasic(SignatureGenerator): self.basewhitelist = set((data.getVar("BB_HASHBASE_WHITELIST", True) or "").split()) self.taskwhitelist = None self.init_rundepcheck(data) + checksum_cache_file = data.getVar("BB_HASH_CHECKSUM_CACHE_FILE", True) + if checksum_cache_file: + self.checksum_cache = FileChecksumCache() + self.checksum_cache.init_cache(data, checksum_cache_file) + else: + self.checksum_cache = None def init_rundepcheck(self, data): self.taskwhitelist = data.getVar("BB_HASHTASK_WHITELIST", True) or None @@ -194,7 +201,10 @@ class SignatureGeneratorBasic(SignatureGenerator): self.runtaskdeps[k].append(dep) if task in dataCache.file_checksums[fn]: - checksums = bb.fetch2.get_file_checksums(dataCache.file_checksums[fn][task], recipename) + if self.checksum_cache: + checksums = self.checksum_cache.get_checksums(dataCache.file_checksums[fn][task], recipename) + else: + checksums = bb.fetch2.get_file_checksums(dataCache.file_checksums[fn][task], recipename) for (f,cs) in checksums: self.file_checksum_values[k][f] = cs if cs: @@ -221,8 +231,12 @@ class SignatureGeneratorBasic(SignatureGenerator): def writeout_file_checksum_cache(self): """Write/update the file checksum cache onto disk""" - bb.fetch2.fetcher_parse_save() - bb.fetch2.fetcher_parse_done() + if self.checksum_cache: + self.checksum_cache.save_extras() + self.checksum_cache.save_merge() + else: + bb.fetch2.fetcher_parse_save() + bb.fetch2.fetcher_parse_done() def dump_sigtask(self, fn, task, stampbase, runtime): k = fn + "." + task |