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
Ben Noordhuis 2012-08-04 02:41:32 +02:00
parent b21c8e0bfd
commit 110e499fe7
1 changed files with 1 additions and 0 deletions

View File

@ -62,6 +62,7 @@ def try_copy(path, dst):
source_path, target_path = mkpaths(path, dst)
print 'installing %s' % target_path
try_mkdir_r(os.path.dirname(target_path))
try_unlink(target_path) # prevent ETXTBSY errors
return shutil.copy2(source_path, target_path)
def try_remove(path, dst):