diff options
| author | Robert Yang <liezhi.yang@windriver.com> | 2024-10-26 02:39:53 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-10-28 14:08:33 +0000 |
| commit | 5bce38fbaea0a7d1228740e2cb313957c914cfdf (patch) | |
| tree | e1a7c1c9bf470729cad00cfc880634310fc09c34 /bitbake/lib/bb/fetch2/gitsm.py | |
| parent | 8d9c02ccfcb2d026a0ed45d288265f8dacfffaee (diff) | |
| download | poky-5bce38fbaea0a7d1228740e2cb313957c914cfdf.tar.gz | |
bitbake: gitsm: Add clean function
Fixed:
$ bitbake utfcpp -cfetch && bitbake utfcpp -ccleanall
The downloads/git2/github.com.nemtrif.ftest won't be cleaned without this fix.
(Bitbake rev: 79f25fc5c1b8d0e08540f4aa07875309f5325f47)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2/gitsm.py')
| -rw-r--r-- | bitbake/lib/bb/fetch2/gitsm.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/bitbake/lib/bb/fetch2/gitsm.py b/bitbake/lib/bb/fetch2/gitsm.py index fab4b1164c..ba62517f08 100644 --- a/bitbake/lib/bb/fetch2/gitsm.py +++ b/bitbake/lib/bb/fetch2/gitsm.py | |||
| @@ -249,6 +249,19 @@ class GitSM(Git): | |||
| 249 | # should also be skipped as these files were already smudged in the fetch stage if lfs | 249 | # should also be skipped as these files were already smudged in the fetch stage if lfs |
| 250 | # was enabled. | 250 | # was enabled. |
| 251 | runfetchcmd("GIT_LFS_SKIP_SMUDGE=1 %s submodule update --recursive --no-fetch" % (ud.basecmd), d, quiet=True, workdir=ud.destdir) | 251 | runfetchcmd("GIT_LFS_SKIP_SMUDGE=1 %s submodule update --recursive --no-fetch" % (ud.basecmd), d, quiet=True, workdir=ud.destdir) |
| 252 | def clean(self, ud, d): | ||
| 253 | def clean_submodule(ud, url, module, modpath, workdir, d): | ||
| 254 | url += ";bareclone=1;nobranch=1" | ||
| 255 | try: | ||
| 256 | newfetch = Fetch([url], d, cache=False) | ||
| 257 | newfetch.clean() | ||
| 258 | except Exception as e: | ||
| 259 | logger.warning('gitsm: submodule clean failed: %s %s' % (type(e).__name__, str(e))) | ||
| 260 | |||
| 261 | self.call_process_submodules(ud, d, True, clean_submodule) | ||
| 262 | |||
| 263 | # Clean top git dir | ||
| 264 | Git.clean(self, ud, d) | ||
| 252 | 265 | ||
| 253 | def implicit_urldata(self, ud, d): | 266 | def implicit_urldata(self, ud, d): |
| 254 | import shutil, subprocess, tempfile | 267 | import shutil, subprocess, tempfile |
