mirror of
https://git.yoctoproject.org/poky
synced 2026-05-08 17:19:20 +00:00
bitbake: gitsm: Remove downloads/tmpdir when failed
The tmpdir such as downloads/tmplp3cnemv won't be removed without this fix. (Bitbake rev: 2ba8d3214759142afc11f0a88d80eb30a8bcde3a) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
04c1ee924b
commit
8d9c02ccfc
@@ -152,9 +152,11 @@ class GitSM(Git):
|
|||||||
# unpacked temporarily so that we can examine the .gitmodules file
|
# unpacked temporarily so that we can examine the .gitmodules file
|
||||||
if ud.shallow and os.path.exists(ud.fullshallow) and extra_check:
|
if ud.shallow and os.path.exists(ud.fullshallow) and extra_check:
|
||||||
tmpdir = tempfile.mkdtemp(dir=d.getVar("DL_DIR"))
|
tmpdir = tempfile.mkdtemp(dir=d.getVar("DL_DIR"))
|
||||||
runfetchcmd("tar -xzf %s" % ud.fullshallow, d, workdir=tmpdir)
|
try:
|
||||||
self.process_submodules(ud, tmpdir, subfunc, d)
|
runfetchcmd("tar -xzf %s" % ud.fullshallow, d, workdir=tmpdir)
|
||||||
shutil.rmtree(tmpdir)
|
self.process_submodules(ud, tmpdir, subfunc, d)
|
||||||
|
finally:
|
||||||
|
shutil.rmtree(tmpdir)
|
||||||
else:
|
else:
|
||||||
self.process_submodules(ud, ud.clonedir, subfunc, d)
|
self.process_submodules(ud, ud.clonedir, subfunc, d)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user