diff options
Diffstat (limited to 'import-layers/yocto-poky/bitbake/lib/bb/cache.py')
-rw-r--r-- | import-layers/yocto-poky/bitbake/lib/bb/cache.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/cache.py b/import-layers/yocto-poky/bitbake/lib/bb/cache.py index dd9cfdfacf..e7eeb4f505 100644 --- a/import-layers/yocto-poky/bitbake/lib/bb/cache.py +++ b/import-layers/yocto-poky/bitbake/lib/bb/cache.py @@ -37,7 +37,7 @@ import bb.utils logger = logging.getLogger("BitBake.Cache") -__cache_version__ = "150" +__cache_version__ = "151" def getCacheFile(path, filename, data_hash): return os.path.join(path, filename + "." + data_hash) @@ -71,7 +71,7 @@ class RecipeInfoCommon(object): @classmethod def flaglist(cls, flag, varlist, metadata, squash=False): - out_dict = dict((var, metadata.getVarFlag(var, flag, True)) + out_dict = dict((var, metadata.getVarFlag(var, flag)) for var in varlist) if squash: return dict((k,v) for (k,v) in out_dict.items() if v) @@ -296,7 +296,7 @@ def parse_recipe(bb_data, bbfile, appends, mc=''): bb_data.setVar("__BBMULTICONFIG", mc) # expand tmpdir to include this topdir - bb_data.setVar('TMPDIR', bb_data.getVar('TMPDIR', True) or "") + bb_data.setVar('TMPDIR', bb_data.getVar('TMPDIR') or "") bbfile_loc = os.path.abspath(os.path.dirname(bbfile)) oldpath = os.path.abspath(os.getcwd()) bb.parse.cached_mtime_noerror(bbfile_loc) @@ -378,7 +378,7 @@ class Cache(NoCache): # It will be used later for deciding whether we # need extra cache file dump/load support self.caches_array = caches_array - self.cachedir = data.getVar("CACHE", True) + self.cachedir = data.getVar("CACHE") self.clean = set() self.checked = set() self.depends_cache = {} @@ -462,6 +462,10 @@ class Cache(NoCache): self.depends_cache[key] = [value] # only fire events on even percentage boundaries current_progress = cachefile.tell() + previous_progress + if current_progress > cachesize: + # we might have calculated incorrect total size because a file + # might've been written out just after we checked its size + cachesize = current_progress current_percent = 100 * current_progress / cachesize if current_percent > previous_percent: previous_percent = current_percent @@ -792,8 +796,8 @@ class MultiProcessCache(object): self.cachedata_extras = self.create_cachedata() def init_cache(self, d, cache_file_name=None): - cachedir = (d.getVar("PERSISTENT_DIR", True) or - d.getVar("CACHE", True)) + cachedir = (d.getVar("PERSISTENT_DIR") or + d.getVar("CACHE")) if cachedir in [None, '']: return bb.utils.mkdirhier(cachedir) |