]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: cache: Create a symlink for current cachefile
authorRobert Yang <liezhi.yang@windriver.com>
Thu, 4 Jul 2019 04:12:37 +0000 (12:12 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 19 Jul 2019 07:45:08 +0000 (08:45 +0100)
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>
bitbake/lib/bb/cache.py

index bec8ef77570141a7905aee6fb33f4c4e07c5d418..ab18dd5eaaf51d096f6b4fc58ed603587b059649 100644 (file)
@@ -396,6 +396,15 @@ class Cache(NoCache):
         else:
             logger.debug(1, "Cache file %s not found, building..." % self.cachefile)
 
+        # We don't use the symlink, its just for debugging convinience
+        symlink = os.path.join(self.cachedir, "bb_cache.dat")
+        if os.path.exists(symlink):
+            bb.utils.remove(symlink)
+        try:
+            os.symlink(os.path.basename(self.cachefile), symlink)
+        except OSError:
+            pass
+
     def load_cachefile(self):
         cachesize = 0
         previous_progress = 0