From 0a45ba64adbc279928a4347c5073eb78da1bf00a Mon Sep 17 00:00:00 2001 From: Robert Yang Date: Sat, 26 Oct 2024 02:39:55 -0700 Subject: [PATCH] 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 Signed-off-by: Richard Purdie --- bitbake/lib/bb/fetch2/git.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py index 0ea55e139d..6badda5972 100644 --- a/bitbake/lib/bb/fetch2/git.py +++ b/bitbake/lib/bb/fetch2/git.py @@ -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)