summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorStefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>2025-09-05 08:20:57 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-11-07 13:15:34 +0000
commita823b0846362d1692aba48f4dee1bb5cd04849db (patch)
tree9535f37bead2f46a34bd6bb9014471cd00248071 /bitbake/lib
parentd49e091accec46012d409cae790e75ea1431b587 (diff)
downloadpoky-a823b0846362d1692aba48f4dee1bb5cd04849db.tar.gz
bitbake: fetch2: gitsm: use TemporaryDirectory instead of mkdtemp
(Bitbake rev: dfcc0d8ed9f70ba363a7a16e8b9e727f08357d96) Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/fetch2/gitsm.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/bitbake/lib/bb/fetch2/gitsm.py b/bitbake/lib/bb/fetch2/gitsm.py
index 31460b19e0..4b6c88baa7 100644
--- a/bitbake/lib/bb/fetch2/gitsm.py
+++ b/bitbake/lib/bb/fetch2/gitsm.py
@@ -20,7 +20,6 @@ NOTE: Switching a SRC_URI from "git://" to "gitsm://" requires a clean of your r
20import os 20import os
21import bb 21import bb
22import copy 22import copy
23import shutil
24import tempfile 23import tempfile
25from bb.fetch2.git import Git 24from bb.fetch2.git import Git
26from bb.fetch2 import runfetchcmd 25from bb.fetch2 import runfetchcmd
@@ -151,12 +150,9 @@ class GitSM(Git):
151 if os.path.exists(ud.clonedir): 150 if os.path.exists(ud.clonedir):
152 self.process_submodules(ud, ud.clonedir, subfunc, d) 151 self.process_submodules(ud, ud.clonedir, subfunc, d)
153 elif ud.shallow and os.path.exists(ud.fullshallow): 152 elif ud.shallow and os.path.exists(ud.fullshallow):
154 tmpdir = tempfile.mkdtemp(dir=d.getVar("DL_DIR")) 153 with tempfile.TemporaryDirectory(dir=d.getVar("DL_DIR")) as tmpdir:
155 try:
156 runfetchcmd("tar -xzf %s" % ud.fullshallow, d, workdir=tmpdir) 154 runfetchcmd("tar -xzf %s" % ud.fullshallow, d, workdir=tmpdir)
157 self.process_submodules(ud, tmpdir, subfunc, d) 155 self.process_submodules(ud, tmpdir, subfunc, d)
158 finally:
159 shutil.rmtree(tmpdir)
160 else: 156 else:
161 raise bb.fetch2.FetchError("Submodule source not available.") 157 raise bb.fetch2.FetchError("Submodule source not available.")
162 158