Commit 8ba40216 authored by Yang Guo's avatar Yang Guo Committed by Commit Bot

Attempt to fix update_node.py wrt read-only files on Windows.

TBR=machenbach@chromium.org

Change-Id: I5b82f56e9b9d894455500de693fe6ac6de5205ae
Reviewed-on: https://chromium-review.googlesource.com/758764
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49259}
parent b9c99322
......@@ -28,6 +28,7 @@ import os
import shutil
import subprocess
import sys
import stat
TARGET_SUBDIR = os.path.join("deps", "v8")
......@@ -61,7 +62,11 @@ def UninitGit(path):
target = os.path.join(path, ".git")
if os.path.isdir(target):
print ">> Cleaning up %s" % path
shutil.rmtree(target)
def OnRmError(func, path, exec_info):
# This might happen on Windows
os.chmod(path, stat.S_IWRITE)
os.unlink(path)
shutil.rmtree(target, onerror=OnRmError)
def CommitPatch(options):
"""Makes a dummy commit for the changes in the index.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment