diff mbox series

[4/5] git: Clean shallow mirror tarball

Message ID a30db7d0be75efca201652c1210aaa4d1b426918.1729933869.git.liezhi.yang@windriver.com
State Accepted, archived
Commit bab7a8970a0237a9d24217685a595e76a1336c07
Headers show
Series [1/5] gitsm: Add call_process_submodules() to remove duplicated code | expand

Commit Message

Robert Yang Oct. 26, 2024, 9:39 a.m. UTC
From: Robert Yang <liezhi.yang@windriver.com>

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.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 lib/bb/fetch2/git.py | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
index 5b678827e..0ea55e139 100644
--- a/lib/bb/fetch2/git.py
+++ b/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)