diff options
| author | Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> | 2025-09-05 08:20:57 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-11-07 13:15:34 +0000 |
| commit | a823b0846362d1692aba48f4dee1bb5cd04849db (patch) | |
| tree | 9535f37bead2f46a34bd6bb9014471cd00248071 /bitbake/lib | |
| parent | d49e091accec46012d409cae790e75ea1431b587 (diff) | |
| download | poky-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.py | 6 |
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 | |||
| 20 | import os | 20 | import os |
| 21 | import bb | 21 | import bb |
| 22 | import copy | 22 | import copy |
| 23 | import shutil | ||
| 24 | import tempfile | 23 | import tempfile |
| 25 | from bb.fetch2.git import Git | 24 | from bb.fetch2.git import Git |
| 26 | from bb.fetch2 import runfetchcmd | 25 | from 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 | ||
