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

Unified Diff: tools/isolate/isolate.py

Issue 9704099: Improve trace_inputs.py to output a format easy to convert to gypi. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix exception 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
« no previous file with comments | « testing/xvfb.py ('k') | tools/isolate/trace_inputs.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/isolate/isolate.py
diff --git a/tools/isolate/isolate.py b/tools/isolate/isolate.py
index 29d883ed681f493bb4c3a76ef268516952551750..e1a93f75245cec856ab4a6d773206c93b398ed4e 100755
--- a/tools/isolate/isolate.py
+++ b/tools/isolate/isolate.py
@@ -104,9 +104,9 @@ def isolate(outdir, resultfile, indir, infiles, mode, read_only, cmd):
dictfiles = tree_creator.process_inputs(
indir, infiles, mode == 'hashtable', read_only)
- if not outdir:
- outdir = os.path.dirname(resultfile)
- result = mode_fn(outdir, indir, dictfiles, read_only, cmd, relative_cwd)
+ result = mode_fn(
+ outdir, indir, dictfiles, read_only, cmd, relative_cwd,
+ os.path.dirname(resultfile))
if result == 0:
# Saves the resulting file.
@@ -120,13 +120,16 @@ def isolate(outdir, resultfile, indir, infiles, mode, read_only, cmd):
return result
-def MODEcheck(outdir, indir, dictfiles, read_only, cmd, relative_cwd):
+def MODEcheck(
+ outdir, indir, dictfiles, read_only, cmd, relative_cwd, result_path):
"""No-op."""
return 0
-def MODEhashtable(outdir, indir, dictfiles, read_only, cmd, relative_cwd):
+def MODEhashtable(
+ outdir, indir, dictfiles, read_only, cmd, relative_cwd, result_path):
"""Ignores read_only, cmd and relative_cwd."""
+ outdir = outdir or result_path
for relfile, properties in dictfiles.iteritems():
infile = os.path.join(indir, relfile)
outfile = os.path.join(outdir, properties['sha-1'])
@@ -139,10 +142,15 @@ def MODEhashtable(outdir, indir, dictfiles, read_only, cmd, relative_cwd):
return 0
-def MODEremap(outdir, indir, dictfiles, read_only, cmd, relative_cwd):
- """Ignores cmd and relative_cwd."""
+def MODEremap(
+ outdir, indir, dictfiles, read_only, cmd, relative_cwd, result_path):
+ """Ignores outdir, cmd and relative_cwd."""
if not outdir:
outdir = tempfile.mkdtemp(prefix='isolate')
+ print 'Remapping into %s' % outdir
+ if len(os.listdir(outdir)):
+ print 'Can\'t remap in a non-empty directory'
+ return 1
tree_creator.recreate_tree(
outdir, indir, dictfiles.keys(), tree_creator.HARDLINK)
if read_only:
@@ -150,9 +158,9 @@ def MODEremap(outdir, indir, dictfiles, read_only, cmd, relative_cwd):
return 0
-def MODErun(outdir, indir, dictfiles, read_only, cmd, relative_cwd):
- """Ignores outdir and always uses a temporary directory."""
- outdir = None
+def MODErun(
+ outdir, indir, dictfiles, read_only, cmd, relative_cwd, result_path):
+ """Always uses a temporary directory."""
try:
outdir = tempfile.mkdtemp(prefix='isolate')
tree_creator.recreate_tree(
« no previous file with comments | « testing/xvfb.py ('k') | tools/isolate/trace_inputs.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698