diff options
author | maruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-05 02:26:45 +0000 |
---|---|---|
committer | maruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-05 02:26:45 +0000 |
commit | 37acddb5a9572a2d61ce82a45a1f6704c35e23d7 (patch) | |
tree | 359e104d0f2d57a1bc2d6ab445da10e685a22b1e | |
parent | b9d1e261eb1a6a91a4f41d39a8bd968470de0ab4 (diff) | |
download | chromium_src-37acddb5a9572a2d61ce82a45a1f6704c35e23d7.zip chromium_src-37acddb5a9572a2d61ce82a45a1f6704c35e23d7.tar.gz chromium_src-37acddb5a9572a2d61ce82a45a1f6704c35e23d7.tar.bz2 |
Fix windows by not looking for symlinks.
TBR=cmp@chromium.org
NOTRY=true
BUG=
TEST=not tested
Review URL: https://chromiumcodereview.appspot.com/10690088
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145494 0039d316-1c4b-4281-b951-d872f2087c98
-rwxr-xr-x | tools/isolate/isolate.py | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/tools/isolate/isolate.py b/tools/isolate/isolate.py index e799c96..ad5da95 100755 --- a/tools/isolate/isolate.py +++ b/tools/isolate/isolate.py @@ -70,32 +70,33 @@ def expand_directory_and_symlink(indir, relfile, blacklist): raise run_test_from_archive.MappingError( 'Can\'t map file %s outside %s' % (infile, indir)) - # Look if any item in relfile is a symlink. - base, symlink, rest = trace_inputs.split_at_symlink(indir, relfile) - if symlink: - # Append everything pointed by the symlink. If the symlink is recursive, - # this code blows up. - symlink_relfile = os.path.join(base, symlink) - symlink_path = os.path.join(indir, symlink_relfile) - pointed = os.readlink(symlink_path) - dest_infile = normpath( - trace_inputs.safe_join( - os.path.join(os.path.dirname(symlink_path), pointed), - rest)) - if not dest_infile.startswith(indir): - raise run_test_from_archive.MappingError( - 'Can\'t map symlink reference %s (from %s) ->%s outside of %s' % - (symlink_relfile, relfile, dest_infile, indir)) - if infile.startswith(dest_infile): - raise run_test_from_archive.MappingError( - 'Can\'t map recursive symlink reference %s->%s' % - (symlink_relfile, dest_infile)) - dest_relfile = dest_infile[len(indir)+1:] - logging.info('Found symlink: %s -> %s' % (symlink_relfile, dest_relfile)) - out = expand_directory_and_symlink(indir, dest_relfile, blacklist) - # Add the symlink itself. - out.append(symlink_relfile) - return out + if sys.platform != 'win32': + # Look if any item in relfile is a symlink. + base, symlink, rest = trace_inputs.split_at_symlink(indir, relfile) + if symlink: + # Append everything pointed by the symlink. If the symlink is recursive, + # this code blows up. + symlink_relfile = os.path.join(base, symlink) + symlink_path = os.path.join(indir, symlink_relfile) + pointed = os.readlink(symlink_path) + dest_infile = normpath( + trace_inputs.safe_join( + os.path.join(os.path.dirname(symlink_path), pointed), + rest)) + if not dest_infile.startswith(indir): + raise run_test_from_archive.MappingError( + 'Can\'t map symlink reference %s (from %s) ->%s outside of %s' % + (symlink_relfile, relfile, dest_infile, indir)) + if infile.startswith(dest_infile): + raise run_test_from_archive.MappingError( + 'Can\'t map recursive symlink reference %s->%s' % + (symlink_relfile, dest_infile)) + dest_relfile = dest_infile[len(indir)+1:] + logging.info('Found symlink: %s -> %s' % (symlink_relfile, dest_relfile)) + out = expand_directory_and_symlink(indir, dest_relfile, blacklist) + # Add the symlink itself. + out.append(symlink_relfile) + return out if relfile.endswith(os.path.sep): if not os.path.isdir(infile): |