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

Unified Diff: tools/isolate/isolate.py

Issue 9621014: Separate xvfb.py logic into its own script (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add --files flag to isolate.py to work around gyp list singletons. Created 8 years, 9 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: tools/isolate/isolate.py
diff --git a/tools/isolate/isolate.py b/tools/isolate/isolate.py
index d70296add3c96b0926751a239187b614aa204479..3e93b3562581fbe5330b95cd443fc6b06a578855 100755
--- a/tools/isolate/isolate.py
+++ b/tools/isolate/isolate.py
@@ -121,14 +121,10 @@ def run(outdir, resultfile, indir, infiles, read_only, cmd):
if read_only:
tree_creator.make_writable(outdir, True)
- # TODO(maruel): Remove me. Layering violation. Used by
- # base/base_paths_linux.cc
- env = os.environ.copy()
- env['CR_SOURCE_ROOT'] = outdir.encode()
# Rebase the command to the right path.
- cmd[0] = os.path.join(outdir, cmd[0])
- logging.info('Running %s' % cmd)
- result = subprocess.call(cmd, cwd=outdir, env=env)
+ cwd = os.path.join(outdir, os.path.relpath(os.getcwd(), indir))
+ logging.info('Running %s, cwd=%s' % (cmd, cwd))
+ result = subprocess.call(cmd, cwd=cwd)
if not result and resultfile:
# Signal the build tool that the test succeeded.
touch(resultfile)
@@ -181,6 +177,9 @@ def main():
parser.add_option(
'--read-only', action='store_true',
help='Make the temporary tree read-only')
+ parser.add_option(
+ '--files', metavar='FILE',
+ help='File to be read containing input files')
options, args = parser.parse_args()
level = [logging.ERROR, logging.INFO, logging.DEBUG][min(2, options.verbose)]
@@ -191,6 +190,12 @@ def main():
if not options.root:
parser.error('--root is required.')
+ if options.files:
+ args = [
+ i.decode('utf-8')
+ for i in open(options.files, 'rb').read().splitlines() if i
+ ] + args
+
infiles, cmd = separate_inputs_command(args, options.root)
if not infiles:
parser.error('Need at least one input file to map')
« base/base.gyp ('K') | « testing/xvfb.py ('k') | tools/isolate/tree_creator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698