summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-13 17:07:51 +0000
committermaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-13 17:07:51 +0000
commit52aef038f682a09347dc8e3ce0ca8e32cad22888 (patch)
treef0a37c5b554d866d90a101510ebd0e186f4aaac5
parent6d8edab029902fc18b2aa844f1980d9318982fab (diff)
downloadchromium_src-52aef038f682a09347dc8e3ce0ca8e32cad22888.zip
chromium_src-52aef038f682a09347dc8e3ce0ca8e32cad22888.tar.gz
chromium_src-52aef038f682a09347dc8e3ce0ca8e32cad22888.tar.bz2
Stop generating DEPTH in trace_inputs.py.
DEPTH support will eventually be removed from isolate.py since this variable is not used inside chromium's gyp anymore. R=nsylvain@chromium.org BUG=98834 TEST= Review URL: http://codereview.chromium.org/10066035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132200 0039d316-1c4b-4281-b951-d872f2087c98
-rwxr-xr-xtools/isolate/trace_inputs.py15
-rwxr-xr-xtools/isolate/trace_inputs_smoke_test.py5
2 files changed, 14 insertions, 6 deletions
diff --git a/tools/isolate/trace_inputs.py b/tools/isolate/trace_inputs.py
index f181946..43cd6ea 100755
--- a/tools/isolate/trace_inputs.py
+++ b/tools/isolate/trace_inputs.py
@@ -16,6 +16,7 @@ import csv
import logging
import optparse
import os
+import posixpath
import re
import subprocess
import sys
@@ -132,6 +133,14 @@ def fix_python_path(cmd):
return out
+def posix_relpath(path, root):
+ """posix.relpath() that keeps trailing slash."""
+ out = posixpath.relpath(path, root)
+ if path.endswith('/'):
+ out += '/'
+ return out
+
+
class Strace(object):
"""strace implies linux."""
IGNORED = (
@@ -1294,12 +1303,10 @@ def trace_inputs(logfile, cmd, root_dir, cwd_dir, product_dir, force_trace):
if product_dir and f.startswith(product_dir):
return '<(PRODUCT_DIR)/%s' % f[len(product_dir):]
- elif cwd_dir and f.startswith(cwd_dir):
+ else:
# cwd_dir is usually the directory containing the gyp file. It may be
# empty if the whole directory containing the gyp file is needed.
- return f[len(cwd_dir):] or './'
- else:
- return '<(DEPTH)/%s' % f
+ return posix_relpath(f, cwd_dir) or './'
corrected = [fix(f) for f in simplified]
tracked = [f for f in corrected if not f.endswith('/') and ' ' not in f]
diff --git a/tools/isolate/trace_inputs_smoke_test.py b/tools/isolate/trace_inputs_smoke_test.py
index 17b8c47..acdbc3c 100755
--- a/tools/isolate/trace_inputs_smoke_test.py
+++ b/tools/isolate/trace_inputs_smoke_test.py
@@ -103,8 +103,9 @@ class TraceInputs(unittest.TestCase):
['OS=="%s"' % trace_inputs.get_flavor(), {
'variables': {
'isolate_dependency_tracked': [
- '<(DEPTH)/trace_inputs.py',
- '<(DEPTH)/%s' % FILENAME,
+ # It is run from data/trace_inputs.
+ '../trace_inputs.py',
+ '../%s' % FILENAME,
],
'isolate_dependency_untracked': [
'trace_inputs/',