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:41:16 +0000 |
commit | 4f0ab27c6a52cc6061fb9e770b77edc8c9cdd99c (patch) | |
tree | 00f9735a176a4e6cf4b0d5279e686613df5692da /bitbake/lib/bb/siggen.py | |
parent | 0cdf1934fd218125ab751145329494f662fcd699 (diff) | |
download | openembedded-core-contrib-4f0ab27c6a52cc6061fb9e770b77edc8c9cdd99c.tar.gz |
bitbake: 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.
(Bitbake rev: a965b390d6240e279c190b92b17c0573e9bd604c)
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/siggen.py')
-rw-r--r-- | bitbake/lib/bb/siggen.py | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py index a7916b29bd..43cf7b6e5a 100644 --- a/bitbake/lib/bb/siggen.py +++ b/bitbake/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 |