Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Unified Diff: native_client_sdk/src/build_tools/buildbot_common.py

Issue 924253002: [NaCL SDK] Add initial support for nacl-clang (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: native_client_sdk/src/build_tools/buildbot_common.py
diff --git a/native_client_sdk/src/build_tools/buildbot_common.py b/native_client_sdk/src/build_tools/buildbot_common.py
index d0186d5538663ef10157b81e8a88de3ae1efb6cd..37aace94badd1da1cbbed9f90b7ce66b9e92e8c0 100644
--- a/native_client_sdk/src/build_tools/buildbot_common.py
+++ b/native_client_sdk/src/build_tools/buildbot_common.py
@@ -10,7 +10,7 @@ import os
import subprocess
import sys
-from build_paths import SDK_SRC_DIR, NACL_DIR
+from build_paths import SDK_SRC_DIR, NACL_DIR, SRC_DIR
sys.path.append(os.path.join(SDK_SRC_DIR, 'tools'))
import oshelpers
@@ -156,19 +156,26 @@ def Run(args, cwd=None, env=None, shell=False):
sys.stderr.flush()
+def ShortFilename(filename):
+ drive = os.path.splitdrive(filename)[0]
+ if drive and drive != os.path.splitdrive(SRC_DIR)[0]:
bradn 2015/02/17 20:21:48 Why is this needed now?
Sam Clegg 2015/02/17 20:31:12 Its not needed, its just makes the output easier t
bradn 2015/02/17 20:33:49 No that's fine, mention in change description?
+ return filename
+ return os.path.relpath(filename, SRC_DIR)
+
+
def CopyDir(src, dst, excludes=('.svn', '*/.svn')):
"""Recursively copy a directory using."""
args = ['-r', src, dst]
for exc in excludes:
args.append('--exclude=' + exc)
- Trace('cp -r %s %s' % (src, dst))
+ Trace('cp -r %s %s' % (ShortFilename(src), ShortFilename(dst)))
if os.path.abspath(src) == os.path.abspath(dst):
ErrorExit('ERROR: Copying directory onto itself: ' + src)
oshelpers.Copy(args)
def CopyFile(src, dst):
- Trace('cp %s %s' % (src, dst))
+ Trace('cp %s %s' % (ShortFilename(src), ShortFilename(dst)))
if os.path.abspath(src) == os.path.abspath(dst):
ErrorExit('ERROR: Copying file onto itself: ' + src)
args = [src, dst]
@@ -177,25 +184,25 @@ def CopyFile(src, dst):
def RemoveDir(dst):
"""Remove the provided path."""
- Trace('rm -fr ' + dst)
+ Trace('rm -fr ' + ShortFilename(dst))
oshelpers.Remove(['-fr', dst])
def MakeDir(dst):
"""Create the path including all parent directories as needed."""
- Trace('mkdir -p ' + dst)
+ Trace('mkdir -p ' + ShortFilename(dst))
oshelpers.Mkdir(['-p', dst])
def Move(src, dst):
"""Move the path src to dst."""
- Trace('mv -f %s %s' % (src, dst))
+ Trace('mv -f %s %s' % (ShortFilename(src), ShortFilename(dst)))
oshelpers.Move(['-f', src, dst])
def RemoveFile(dst):
"""Remove the provided file."""
- Trace('rm ' + dst)
+ Trace('rm ' + ShortFilename(dst))
oshelpers.Remove(['-f', dst])

Powered by Google App Engine
This is Rietveld 408576698