Remove out/apprtc using Cygwin for Windows bots.
This requires Cygwin to be installed in c:\cygwin, which
is the case on all our Windows testers.
BUG=567538
R=phoglund@chromium.org
Review URL: https://codereview.chromium.org/1562343003 .
diff --git a/copy_apprtc.py b/copy_apprtc.py
index ca4750e..c0a6d5d 100755
--- a/copy_apprtc.py
+++ b/copy_apprtc.py
@@ -8,6 +8,7 @@
import fileinput
import os
import shutil
+import subprocess
import sys
import utils
@@ -25,9 +26,23 @@
sys.stdout.write(line)
+def RemoveDirectory(*path):
+ if utils.GetPlatform() == 'win':
+ # Allow clobbering of out dir using cygwin until crbug.com/567538 is fixed.
+ drive, path = os.path.splitdrive(os.path.abspath(path))
+ drive = drive.lower()[0]
+ cygwin_full_path = '/cygdrive/%s%s' % (drive, path.replace('\\', '/'))
+
+ # Now it should be like /cygdrive/c/b/build/slave/Win7_Tester/build/src/out
+ cmd = 'c:\\cygwin\\bin\\bash --login -c "rm -rf %s"' % cygwin_full_path
+ subprocess.check_call(cmd)
+ else:
+ utils.RemoveDirectory(path)
+
+
def main():
target_dir = os.path.join('src', 'out', 'apprtc')
- utils.RemoveDirectory(target_dir)
+ RemoveDirectory(target_dir)
shutil.copytree('apprtc',
target_dir, ignore=shutil.ignore_patterns('.svn', '.git'))