From a957e27dc1a528f3725a2374250b12ef925f95fc Mon Sep 17 00:00:00 2001 From: "rnk@chromium.org" Date: Thu, 16 Jan 2014 20:59:47 +0000 Subject: [PATCH] Fetch Windows tools on Cygwin and use that Python for some scripts Tested by running gclient sync a couple of times from a Cygwin shell. R=dpranke@chromium.org CC=scottmg@chromium.org,thakis@chromium.org,maruel@chromium.org BUG=335180 Review URL: https://codereview.chromium.org/140843004 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@245315 0039d316-1c4b-4281-b951-d872f2087c98 --- fetch | 10 +++++++++- gclient | 10 +++++++++- update_depot_tools | 7 +++++++ 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/fetch b/fetch index 37e8e795d..1b9709848 100755 --- a/fetch +++ b/fetch @@ -9,4 +9,12 @@ if [[ "#grep#fetch#cleanup#diff#" != *"#$1#"* ]]; then "$base_dir"/update_depot_tools fi -PYTHONDONTWRITEBYTECODE=1 exec python "$base_dir/fetch.py" "$@" +PYTHON=python + +OUTPUT="$(uname | grep 'CYGWIN')" +CYGWIN=$? +if [ $CYGWIN = 0 ]; then + PYTHON="$base_dir/python.bat" +fi + +PYTHONDONTWRITEBYTECODE=1 exec "$PYTHON" "$base_dir/fetch.py" "$@" diff --git a/gclient b/gclient index 7c57dfdea..5f8920bfc 100755 --- a/gclient +++ b/gclient @@ -9,4 +9,12 @@ if [[ "#grep#fetch#cleanup#diff#" != *"#$1#"* ]]; then "$base_dir"/update_depot_tools fi -PYTHONDONTWRITEBYTECODE=1 exec python "$base_dir/gclient.py" "$@" +PYTHON=python + +OUTPUT="$(uname | grep 'CYGWIN')" +CYGWIN=$? +if [ $CYGWIN = 0 ]; then + PYTHON="$base_dir/python.bat" +fi + +PYTHONDONTWRITEBYTECODE=1 exec "$PYTHON" "$base_dir/gclient.py" "$@" diff --git a/update_depot_tools b/update_depot_tools index a146724ff..f71e7f4fe 100755 --- a/update_depot_tools +++ b/update_depot_tools @@ -17,6 +17,13 @@ then base_dir=`cd "$base_dir" && pwd -P` fi +# Don't try to use Cygwin tools. Get real win32 tools using the batch script. +OUTPUT="$(uname | grep 'CYGWIN')" +CYGWIN=$? +if [ $CYGWIN = 0 ]; then + exec cmd /c "$base_dir/bootstrap/win/win_tools.bat" force +fi + # Test if this script is running under a MSys install. If it is, we will # hardcode the paths to SVN and Git where possible. OUTPUT="$(uname | grep 'MINGW')"