cache: Remove invalid symlink for bb_cache.dat
cover cache: Remove invalid symlink for bb_cache.dat
From: Robert Yang <[email protected]>
The following changes since commit 5d88faa0f35f0205c1475893d8589d1e6533dcc0:
bitbake: siggen: catch FileNotFoundError everywhere and ConnectionError also in get_unihashes (2024-06-18 08:45:22 +0100)
are available in the Git repository at:
https://github.com/robertlinux/yocto rbt/bb_cache
https://github.com/robertlinux/yocto/tree/rbt/bb_cache
Robert Yang (1):
cache: Remove invalid symlink for bb_cache.dat
bitbake/lib/bb/cache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
2.45.1
PATCH 1/1 cache: Remove invalid symlink for bb_cache.dat
From: Robert Yang <[email protected]>
The bb_cache.dat might be an invalid symlink when error happens, then os.path.exists(symlink) would return False for it, the invalid symlink wouldn't be removed and os.symlink can't update it any more.
Use os.path.islink(symlink) can fix the problem.
--- bitbake/lib/bb/cache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
bitbake/lib/bb/cache.py +1 -1
@@ -441,7 +441,7 @@ class Cache(object): else: symlink = os.path.join(self.cachedir, "bb_cache.dat") - if os.path.exists(symlink): + if os.path.exists(symlink) or os.path.islink(symlink): bb.utils.remove(symlink) try: os.symlink(os.path.basename(self.cachefile), symlink)
Signature · 1 line
2.45.1