mirror of https://github.com/nodejs/node.git
installer: prevent ETXTBSY errors
The installer does what amounts to `cp -p`. If the node binary is in use at the time of the copy, it'd fail with a ETXTBSY error. That's why it's unlinked first now.pull/24503/head
parent
b21c8e0bfd
commit
110e499fe7
|
@ -62,6 +62,7 @@ def try_copy(path, dst):
|
||||||
source_path, target_path = mkpaths(path, dst)
|
source_path, target_path = mkpaths(path, dst)
|
||||||
print 'installing %s' % target_path
|
print 'installing %s' % target_path
|
||||||
try_mkdir_r(os.path.dirname(target_path))
|
try_mkdir_r(os.path.dirname(target_path))
|
||||||
|
try_unlink(target_path) # prevent ETXTBSY errors
|
||||||
return shutil.copy2(source_path, target_path)
|
return shutil.copy2(source_path, target_path)
|
||||||
|
|
||||||
def try_remove(path, dst):
|
def try_remove(path, dst):
|
||||||
|
|
Loading…
Reference in New Issue