summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb')
-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 95cd971d56..00105183b7 100644
--- a/bitbake/lib/bb/fetch2/git.py
+++ b/bitbake/lib/bb/fetch2/git.py
@@ -418,14 +418,14 @@ class Git(FetchMethod):
418 418
419 # Create as a temp file and move atomically into position to avoid races 419 # Create as a temp file and move atomically into position to avoid races
420 @contextmanager 420 @contextmanager
421 def create_atomic(filename, d): 421 def create_atomic(filename):
422 fd, tfile = tempfile.mkstemp(dir=os.path.dirname(filename)) 422 fd, tfile = tempfile.mkstemp(dir=os.path.dirname(filename))
423 try: 423 try:
424 yield tfile 424 yield tfile
425 umask = os.umask(0o666) 425 umask = os.umask(0o666)
426 os.umask(umask) 426 os.umask(umask)
427 os.chmod(tfile, (0o666 & ~umask)) 427 os.chmod(tfile, (0o666 & ~umask))
428 runfetchcmd("mv %s %s" % (tfile, filename), d) 428 os.rename(tfile, filename)
429 finally: 429 finally:
430 os.close(fd) 430 os.close(fd)
431 431
@@ -439,7 +439,7 @@ class Git(FetchMethod):
439 self.clone_shallow_local(ud, shallowclone, d) 439 self.clone_shallow_local(ud, shallowclone, d)
440 440
441 logger.info("Creating tarball of git repository") 441 logger.info("Creating tarball of git repository")
442 with create_atomic(ud.fullshallow, d) as tfile: 442 with create_atomic(ud.fullshallow) as tfile:
443 runfetchcmd("tar -czf %s ." % tfile, d, workdir=shallowclone) 443 runfetchcmd("tar -czf %s ." % tfile, d, workdir=shallowclone)
444 runfetchcmd("touch %s.done" % ud.fullshallow, d) 444 runfetchcmd("touch %s.done" % ud.fullshallow, d)
445 finally: 445 finally:
@@ -449,7 +449,7 @@ class Git(FetchMethod):
449 os.unlink(ud.fullmirror) 449 os.unlink(ud.fullmirror)
450 450
451 logger.info("Creating tarball of git repository") 451 logger.info("Creating tarball of git repository")
452 with create_atomic(ud.fullmirror, d) as tfile: 452 with create_atomic(ud.fullmirror) as tfile:
453 runfetchcmd("tar -czf %s ." % tfile, d, workdir=ud.clonedir) 453 runfetchcmd("tar -czf %s ." % tfile, d, workdir=ud.clonedir)
454 runfetchcmd("touch %s.done" % ud.fullmirror, d) 454 runfetchcmd("touch %s.done" % ud.fullmirror, d)
455 455