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:15:08 -0700 |
commit | 26faea17ca18f789447f98984b60cbdc61e41ebe (patch) | |
tree | 31d2be1fe3097e6a9e7c79ceaf1f6d5cad961c0b | |
parent | 8509d1158d9d54ccba74557c246ebfe2fc4c1c47 (diff) | |
download | poky-26faea17ca18f789447f98984b60cbdc61e41ebe.tar.gz |
bitbake: gitsm: Remove downloads/tmpdir when failed
The tmpdir such as downloads/tmplp3cnemv won't be removed without this fix.
(Bitbake rev: 03387d4f60cbf2ae93bb48d53688fa71197f5179)
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>
-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 17aac6357c..fab4b1164c 100644 --- a/bitbake/lib/bb/fetch2/gitsm.py +++ b/bitbake/lib/bb/fetch2/gitsm.py | |||
@@ -152,9 +152,11 @@ class GitSM(Git): | |||
152 | # unpacked temporarily so that we can examine the .gitmodules file | 152 | # unpacked temporarily so that we can examine the .gitmodules file |
153 | if ud.shallow and os.path.exists(ud.fullshallow) and extra_check: | 153 | if ud.shallow and os.path.exists(ud.fullshallow) and extra_check: |
154 | tmpdir = tempfile.mkdtemp(dir=d.getVar("DL_DIR")) | 154 | tmpdir = tempfile.mkdtemp(dir=d.getVar("DL_DIR")) |
155 | runfetchcmd("tar -xzf %s" % ud.fullshallow, d, workdir=tmpdir) | 155 | try: |
156 | self.process_submodules(ud, tmpdir, subfunc, d) | 156 | runfetchcmd("tar -xzf %s" % ud.fullshallow, d, workdir=tmpdir) |
157 | shutil.rmtree(tmpdir) | 157 | self.process_submodules(ud, tmpdir, subfunc, d) |
158 | finally: | ||
159 | shutil.rmtree(tmpdir) | ||
158 | else: | 160 | else: |
159 | self.process_submodules(ud, ud.clonedir, subfunc, d) | 161 | self.process_submodules(ud, ud.clonedir, subfunc, d) |
160 | 162 | ||