diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2019-07-04 12:12:37 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-07-19 08:45:08 +0100 |
commit | b70993cf922411260b42986c5501b72550719f5b (patch) | |
tree | d3171c5ed579661fb7d2e3c6d5477f7494bbd1b8 /bitbake/lib/bb/cache.py | |
parent | 58589bc5382b5c77825bc963a1c84a4e8f54498f (diff) | |
download | poky-b70993cf922411260b42986c5501b72550719f5b.tar.gz |
bitbake: cache: Create a symlink for current cachefile
So that people or other tools can easily know which one is being used, just
like what we did for run.do_task and log.do_task, otherwise, we have no way
to know it. I usually use "ls -t", but it isn't reliable since the one which
is being used may not the latest one.
(Bitbake rev: cf286dff653eed542bf347ca46234c224944d5b0)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/cache.py')
-rw-r--r-- | bitbake/lib/bb/cache.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/bitbake/lib/bb/cache.py b/bitbake/lib/bb/cache.py index bec8ef7757..ab18dd5eaa 100644 --- a/bitbake/lib/bb/cache.py +++ b/bitbake/lib/bb/cache.py | |||
@@ -396,6 +396,15 @@ class Cache(NoCache): | |||
396 | else: | 396 | else: |
397 | logger.debug(1, "Cache file %s not found, building..." % self.cachefile) | 397 | logger.debug(1, "Cache file %s not found, building..." % self.cachefile) |
398 | 398 | ||
399 | # We don't use the symlink, its just for debugging convinience | ||
400 | symlink = os.path.join(self.cachedir, "bb_cache.dat") | ||
401 | if os.path.exists(symlink): | ||
402 | bb.utils.remove(symlink) | ||
403 | try: | ||
404 | os.symlink(os.path.basename(self.cachefile), symlink) | ||
405 | except OSError: | ||
406 | pass | ||
407 | |||
399 | def load_cachefile(self): | 408 | def load_cachefile(self): |
400 | cachesize = 0 | 409 | cachesize = 0 |
401 | previous_progress = 0 | 410 | previous_progress = 0 |