From 062acf8862a1d136e673bd97f3a7f1f80f24eadf Mon Sep 17 00:00:00 2001 From: "thakis@chromium.org" Date: Tue, 11 Aug 2015 22:06:04 +0000 Subject: [PATCH] Add a --force flag to get_toolchain_if_necessary.py to let it run on non-Windows. BUG=495204 Review URL: https://codereview.chromium.org/1284723006 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@296272 0039d316-1c4b-4281-b951-d872f2087c98 --- win_toolchain/get_toolchain_if_necessary.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/win_toolchain/get_toolchain_if_necessary.py b/win_toolchain/get_toolchain_if_necessary.py index 7187bf491..c38785d17 100755 --- a/win_toolchain/get_toolchain_if_necessary.py +++ b/win_toolchain/get_toolchain_if_necessary.py @@ -213,14 +213,16 @@ def DoTreeMirror(target_dir, tree_sha1): def main(): - if not sys.platform.startswith(('cygwin', 'win32')): - return 0 - parser = optparse.OptionParser(description=sys.modules[__name__].__doc__) parser.add_option('--output-json', metavar='FILE', help='write information about toolchain to FILE') + parser.add_option('--force', action='store_true', + help='force script to run on non-Windows hosts') options, args = parser.parse_args() + if not (sys.platform.startswith(('cygwin', 'win32')) or options.force): + return 0 + if sys.platform == 'cygwin': # This script requires Windows Python, so invoke with depot_tools' Python. def winpath(path):