bitbake: git: Clean broken symlink

The file may be a symlink when mirror from local disk, and the symlink will be
broken when the linked file is removed, use os.path.islink() to check and
remove the broken symlink.

(Bitbake rev: d0deb5fe6e7a84b07b49ef685b209729d2fdc780)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Robert Yang
2024-10-26 02:39:55 -07:00
committed by Richard Purdie
parent dd9d183621
commit 0a45ba64ad

View File

@@ -733,7 +733,7 @@ class Git(FetchMethod):
to_remove.append(ud.fullshallow + ".done")
for r in to_remove:
if os.path.exists(r):
if os.path.exists(r) or os.path.islink(r):
bb.note('Removing %s' % r)
bb.utils.remove(r, True)