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