diff options
| author | Robert Yang <liezhi.yang@windriver.com> | 2024-10-26 02:39:52 -0700 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2024-11-02 06:06:09 -0700 |
| commit | 3064d8a9dc5397407af35c61a2da44e7ff01d008 (patch) | |
| tree | d579efa89527813c193ef2164f0116a17ae86267 /bitbake | |
| parent | e66f081f5197cd6b5c956b3a8fa5e563a1b41fd5 (diff) | |
| download | poky-3064d8a9dc5397407af35c61a2da44e7ff01d008.tar.gz | |
bitbake: gitsm: Remove downloads/tmpdir when failed
The tmpdir such as downloads/tmplp3cnemv won't be removed without this fix.
(Bitbake rev: 15582daed9a18330bcf1ad316a57d46571bbf7c6)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 2ba8d3214759142afc11f0a88d80eb30a8bcde3a)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'bitbake')
| -rw-r--r-- | bitbake/lib/bb/fetch2/gitsm.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/bitbake/lib/bb/fetch2/gitsm.py b/bitbake/lib/bb/fetch2/gitsm.py index 0699645fbf..488e99cde6 100644 --- a/bitbake/lib/bb/fetch2/gitsm.py +++ b/bitbake/lib/bb/fetch2/gitsm.py | |||
| @@ -144,9 +144,11 @@ class GitSM(Git): | |||
| 144 | # unpacked temporarily so that we can examine the .gitmodules file | 144 | # unpacked temporarily so that we can examine the .gitmodules file |
| 145 | if ud.shallow and os.path.exists(ud.fullshallow) and extra_check: | 145 | if ud.shallow and os.path.exists(ud.fullshallow) and extra_check: |
| 146 | tmpdir = tempfile.mkdtemp(dir=d.getVar("DL_DIR")) | 146 | tmpdir = tempfile.mkdtemp(dir=d.getVar("DL_DIR")) |
| 147 | runfetchcmd("tar -xzf %s" % ud.fullshallow, d, workdir=tmpdir) | 147 | try: |
| 148 | self.process_submodules(ud, tmpdir, subfunc, d) | 148 | runfetchcmd("tar -xzf %s" % ud.fullshallow, d, workdir=tmpdir) |
| 149 | shutil.rmtree(tmpdir) | 149 | self.process_submodules(ud, tmpdir, subfunc, d) |
| 150 | finally: | ||
| 151 | shutil.rmtree(tmpdir) | ||
| 150 | else: | 152 | else: |
| 151 | self.process_submodules(ud, ud.clonedir, subfunc, d) | 153 | self.process_submodules(ud, ud.clonedir, subfunc, d) |
| 152 | 154 | ||
