Skip to contentSkip to conversation

cache: Create a symlink for current cachefile

PATCH In review Robert Yang 1 participant 4 messages Jul 4, 2019 – Jul 18, 2019

lore
Share & tools
lore
#0 lore raw

cover cache: Create a symlink for current cachefile

The following changes since commit 4fd9ee4670293632cc0ca1e64b8833eb6014435d:

  bitbake: bitbake: Add --skip-setscene option (2019-07-03 17:00:57 +0100)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib rbt/symlink
http://git.pokylinux.org/cgit.cgi//log/?h=rbt/symlink

Robert Yang (1):
cache: Create a symlink for current cachefile

 bitbake/lib/bb/cache.py | 8 ++++++++
 1 file changed, 8 insertions(+)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 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/lib/bb/cache.py | 8 ++++++++
 1 file changed, 8 insertions(+)
bitbake/lib/bb/cache.py +8 -0
index 5fb2f17..c813d6a 100644
@@ -399,6 +399,14 @@ class Cache(NoCache):
         else:
             logger.debug(1, "Cache file %s not found, building..." % self.cachefile)
 
+        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
Signature · 1 line
2.7.4
#2 lore raw
In reply to Robert Yang

Hi RP,

Do you have any comments on this, please?

// Robert

Quoted 15 lines · Robert Yang

The following changes since commit 4fd9ee4670293632cc0ca1e64b8833eb6014435d:

   bitbake: bitbake: Add --skip-setscene option (2019-07-03 17:00:57 +0100)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib rbt/symlink
http://git.pokylinux.org/cgit.cgi//log/?h=rbt/symlink

Robert Yang (1):
cache: Create a symlink for current cachefile

  bitbake/lib/bb/cache.py | 8 ++++++++
  1 file changed, 8 insertions(+)
#3 lore raw
In reply to Robert Yang

Hi RP,

Do you have any comments or concerns on this one, please?

// Robert

Quoted 15 lines · Robert Yang

The following changes since commit 4fd9ee4670293632cc0ca1e64b8833eb6014435d:

   bitbake: bitbake: Add --skip-setscene option (2019-07-03 17:00:57 +0100)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib rbt/symlink
http://git.pokylinux.org/cgit.cgi//log/?h=rbt/symlink

Robert Yang (1):
cache: Create a symlink for current cachefile

  bitbake/lib/bb/cache.py | 8 ++++++++
  1 file changed, 8 insertions(+)