diff options
Diffstat (limited to 'bitbake/lib/bb/fetch2')
-rw-r--r-- | bitbake/lib/bb/fetch2/git.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py index 7ea8974204..5bb8393133 100644 --- a/bitbake/lib/bb/fetch2/git.py +++ b/bitbake/lib/bb/fetch2/git.py | |||
@@ -417,8 +417,7 @@ class Git(FetchMethod): | |||
417 | # It would be nice to just do this inline here by running 'git-lfs fetch' | 417 | # It would be nice to just do this inline here by running 'git-lfs fetch' |
418 | # on the bare clonedir, but that operation requires a working copy on some | 418 | # on the bare clonedir, but that operation requires a working copy on some |
419 | # releases of Git LFS. | 419 | # releases of Git LFS. |
420 | tmpdir = tempfile.mkdtemp(dir=d.getVar('DL_DIR')) | 420 | with tempfile.TemporaryDirectory(dir=d.getVar('DL_DIR')) as tmpdir: |
421 | try: | ||
422 | # Do the checkout. This implicitly involves a Git LFS fetch. | 421 | # Do the checkout. This implicitly involves a Git LFS fetch. |
423 | Git.unpack(self, ud, tmpdir, d) | 422 | Git.unpack(self, ud, tmpdir, d) |
424 | 423 | ||
@@ -436,8 +435,6 @@ class Git(FetchMethod): | |||
436 | # downloaded. | 435 | # downloaded. |
437 | if os.path.exists(os.path.join(tmpdir, "git", ".git", "lfs")): | 436 | if os.path.exists(os.path.join(tmpdir, "git", ".git", "lfs")): |
438 | runfetchcmd("tar -cf - lfs | tar -xf - -C %s" % ud.clonedir, d, workdir="%s/git/.git" % tmpdir) | 437 | runfetchcmd("tar -cf - lfs | tar -xf - -C %s" % ud.clonedir, d, workdir="%s/git/.git" % tmpdir) |
439 | finally: | ||
440 | bb.utils.remove(tmpdir, recurse=True) | ||
441 | 438 | ||
442 | def build_mirror_data(self, ud, d): | 439 | def build_mirror_data(self, ud, d): |
443 | 440 | ||