bitbake: git: Clean shallow mirror tarball

Fixed:
BB_GIT_SHALLOW = "1"
BB_GENERATE_SHALLOW_TARBALLS = "1"
$ bitbake utfcpp -cfetch && bitbake utfcpp -ccleanall

The downloads/gitsmshallow_github.com.nemtrif.*.tar.gz won't be cleaned without
this fix.

(Bitbake rev: bab7a8970a0237a9d24217685a595e76a1336c07)

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:54 -07:00
committed by Richard Purdie
parent 5bce38fbae
commit dd9d183621

View File

@@ -727,6 +727,11 @@ class Git(FetchMethod):
clonedir = os.path.realpath(ud.localpath)
to_remove.append(clonedir)
# Remove shallow mirror tarball
if ud.shallow:
to_remove.append(ud.fullshallow)
to_remove.append(ud.fullshallow + ".done")
for r in to_remove:
if os.path.exists(r):
bb.note('Removing %s' % r)