summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2/git.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/fetch2/git.py')
-rw-r--r--bitbake/lib/bb/fetch2/git.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
index 81335c117e..000aee190d 100644
--- a/bitbake/lib/bb/fetch2/git.py
+++ b/bitbake/lib/bb/fetch2/git.py
@@ -412,14 +412,14 @@ class Git(FetchMethod):
412 412
413 # Create as a temp file and move atomically into position to avoid races 413 # Create as a temp file and move atomically into position to avoid races
414 @contextmanager 414 @contextmanager
415 def create_atomic(filename, d): 415 def create_atomic(filename):
416 fd, tfile = tempfile.mkstemp(dir=os.path.dirname(filename)) 416 fd, tfile = tempfile.mkstemp(dir=os.path.dirname(filename))
417 try: 417 try:
418 yield tfile 418 yield tfile
419 umask = os.umask(0o666) 419 umask = os.umask(0o666)
420 os.umask(umask) 420 os.umask(umask)
421 os.chmod(tfile, (0o666 & ~umask)) 421 os.chmod(tfile, (0o666 & ~umask))
422 runfetchcmd("mv %s %s" % (tfile, filename), d) 422 os.rename(tfile, filename)
423 finally: 423 finally:
424 os.close(fd) 424 os.close(fd)
425 425
@@ -433,7 +433,7 @@ class Git(FetchMethod):
433 self.clone_shallow_local(ud, shallowclone, d) 433 self.clone_shallow_local(ud, shallowclone, d)
434 434
435 logger.info("Creating tarball of git repository") 435 logger.info("Creating tarball of git repository")
436 with create_atomic(ud.fullshallow, d) as tfile: 436 with create_atomic(ud.fullshallow) as tfile:
437 runfetchcmd("tar -czf %s ." % tfile, d, workdir=shallowclone) 437 runfetchcmd("tar -czf %s ." % tfile, d, workdir=shallowclone)
438 runfetchcmd("touch %s.done" % ud.fullshallow, d) 438 runfetchcmd("touch %s.done" % ud.fullshallow, d)
439 finally: 439 finally:
@@ -443,7 +443,7 @@ class Git(FetchMethod):
443 os.unlink(ud.fullmirror) 443 os.unlink(ud.fullmirror)
444 444
445 logger.info("Creating tarball of git repository") 445 logger.info("Creating tarball of git repository")
446 with create_atomic(ud.fullmirror, d) as tfile: 446 with create_atomic(ud.fullmirror) as tfile:
447 runfetchcmd("tar -czf %s ." % tfile, d, workdir=ud.clonedir) 447 runfetchcmd("tar -czf %s ." % tfile, d, workdir=ud.clonedir)
448 runfetchcmd("touch %s.done" % ud.fullmirror, d) 448 runfetchcmd("touch %s.done" % ud.fullmirror, d)
449 449