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 | |
parent | 0cdf1934fd218125ab751145329494f662fcd699 (diff) | |
download | poky-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>
-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 | |||
4 | import re | 4 | import re |
5 | import tempfile | 5 | import tempfile |
6 | import bb.data | 6 | import bb.data |
7 | from bb.checksum import FileChecksumCache | ||
7 | 8 | ||
8 | logger = logging.getLogger('BitBake.SigGen') | 9 | logger = logging.getLogger('BitBake.SigGen') |
9 | 10 | ||
@@ -91,6 +92,12 @@ class SignatureGeneratorBasic(SignatureGenerator): | |||
91 | self.basewhitelist = set((data.getVar("BB_HASHBASE_WHITELIST", True) or "").split()) | 92 | self.basewhitelist = set((data.getVar("BB_HASHBASE_WHITELIST", True) or "").split()) |
92 | self.taskwhitelist = None | 93 | self.taskwhitelist = None |
93 | self.init_rundepcheck(data) | 94 | self.init_rundepcheck(data) |
95 | checksum_cache_file = data.getVar("BB_HASH_CHECKSUM_CACHE_FILE", True) | ||
96 | if checksum_cache_file: | ||
97 | self.checksum_cache = FileChecksumCache() | ||
98 | self.checksum_cache.init_cache(data, checksum_cache_file) | ||
99 | else: | ||
100 | self.checksum_cache = None | ||
94 | 101 | ||
95 | def init_rundepcheck(self, data): | 102 | def init_rundepcheck(self, data): |
96 | self.taskwhitelist = data.getVar("BB_HASHTASK_WHITELIST", True) or None | 103 | self.taskwhitelist = data.getVar("BB_HASHTASK_WHITELIST", True) or None |
@@ -194,7 +201,10 @@ class SignatureGeneratorBasic(SignatureGenerator): | |||
194 | self.runtaskdeps[k].append(dep) | 201 | self.runtaskdeps[k].append(dep) |
195 | 202 | ||
196 | if task in dataCache.file_checksums[fn]: | 203 | if task in dataCache.file_checksums[fn]: |
197 | checksums = bb.fetch2.get_file_checksums(dataCache.file_checksums[fn][task], recipename) | 204 | if self.checksum_cache: |
205 | checksums = self.checksum_cache.get_checksums(dataCache.file_checksums[fn][task], recipename) | ||
206 | else: | ||
207 | checksums = bb.fetch2.get_file_checksums(dataCache.file_checksums[fn][task], recipename) | ||
198 | for (f,cs) in checksums: | 208 | for (f,cs) in checksums: |
199 | self.file_checksum_values[k][f] = cs | 209 | self.file_checksum_values[k][f] = cs |
200 | if cs: | 210 | if cs: |
@@ -221,8 +231,12 @@ class SignatureGeneratorBasic(SignatureGenerator): | |||
221 | 231 | ||
222 | def writeout_file_checksum_cache(self): | 232 | def writeout_file_checksum_cache(self): |
223 | """Write/update the file checksum cache onto disk""" | 233 | """Write/update the file checksum cache onto disk""" |
224 | bb.fetch2.fetcher_parse_save() | 234 | if self.checksum_cache: |
225 | bb.fetch2.fetcher_parse_done() | 235 | self.checksum_cache.save_extras() |
236 | self.checksum_cache.save_merge() | ||
237 | else: | ||
238 | bb.fetch2.fetcher_parse_save() | ||
239 | bb.fetch2.fetcher_parse_done() | ||
226 | 240 | ||
227 | def dump_sigtask(self, fn, task, stampbase, runtime): | 241 | def dump_sigtask(self, fn, task, stampbase, runtime): |
228 | k = fn + "." + task | 242 | k = fn + "." + task |