forked from cory/tildefriends
Try to work around shutil.rmtree permission denied problem.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3238 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
parent
80d392bffe
commit
08dac879d7
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
import stat
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
@ -29,6 +30,13 @@ def run(*args, **kw):
|
|||||||
print 'Running:', args, kw
|
print 'Running:', args, kw
|
||||||
subprocess.check_call(*args, **kw)
|
subprocess.check_call(*args, **kw)
|
||||||
|
|
||||||
|
def makeWritableAndRetry(function, path, exc_info):
|
||||||
|
if not os.access(path, os.W_OK):
|
||||||
|
os.chmod(path, stat.S_IWUSR)
|
||||||
|
function(path)
|
||||||
|
else:
|
||||||
|
raise
|
||||||
|
|
||||||
def updateUv():
|
def updateUv():
|
||||||
print 'libuv'
|
print 'libuv'
|
||||||
print
|
print
|
||||||
@ -45,7 +53,7 @@ def updateUv():
|
|||||||
if clean:
|
if clean:
|
||||||
if os.path.isdir(os.path.join(kUvWork)):
|
if os.path.isdir(os.path.join(kUvWork)):
|
||||||
print 'Cleaning', kUvWork
|
print 'Cleaning', kUvWork
|
||||||
shutil.rmtree(os.path.join(kUvWork))
|
shutil.rmtree(os.path.join(kUvWork), onerror=makeWritableAndRetry)
|
||||||
if not os.path.isdir(kUvWork):
|
if not os.path.isdir(kUvWork):
|
||||||
run(['git', 'clone', '--branch', kUvBranch, kUvRepository, kUvWork])
|
run(['git', 'clone', '--branch', kUvBranch, kUvRepository, kUvWork])
|
||||||
open(os.path.join(kUvWork, '.update-deps-branch'), 'w').write(kUvBranch)
|
open(os.path.join(kUvWork, '.update-deps-branch'), 'w').write(kUvBranch)
|
||||||
@ -81,7 +89,7 @@ def updateV8():
|
|||||||
|
|
||||||
if clean:
|
if clean:
|
||||||
if os.path.isdir(kV8Work):
|
if os.path.isdir(kV8Work):
|
||||||
shutil.rmtree(kV8Work)
|
shutil.rmtree(kV8Work, onerror=makeWritableAndRetry)
|
||||||
|
|
||||||
if True or sys.platform == 'linux2':
|
if True or sys.platform == 'linux2':
|
||||||
# XXX Modify this one .py file which assumes things that conflict with my debian environment.
|
# XXX Modify this one .py file which assumes things that conflict with my debian environment.
|
||||||
|
Loading…
Reference in New Issue
Block a user