From cf231ddddbeaa1309bc5cef400443011677e3e77 Mon Sep 17 00:00:00 2001 From: "iannucci@chromium.org" Date: Wed, 30 Mar 2016 02:45:15 +0000 Subject: [PATCH] Add warning when running gclient under MSYS shell. R=dnj@chromium.org, pkasting@chromium.org BUG=598941 Review URL: https://codereview.chromium.org/1847433002 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@299559 0039d316-1c4b-4281-b951-d872f2087c98 --- update_depot_tools | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/update_depot_tools b/update_depot_tools index 0177877d4..9d9d65653 100755 --- a/update_depot_tools +++ b/update_depot_tools @@ -11,7 +11,21 @@ then exit fi -# Test if this script is running under a MSys install. If it is, we will +# Test if this script is running under a MSYS install. This is likely an error +# if it is, so we warn the user accordingly. +OUTPUT="$(uname | grep 'MSYS')" +MSYS=$? +if [ $MSYS = 0 ]; then + echo 'WARNING: It looks like you are running these tools from an MSYS shell' + echo '(as opposed to a MinGW shell). This shell is not supported and may' + echo 'fail in mysterious ways.' + echo + echo 'To run the supported MinGW shell, use `git bash`, or use `bin/bash.exe`' + echo 'in your MinGW installation, as opposed to `usr/bin/bash.exe`.' + echo +fi + +# Test if this script is running under a MinGW install. If it is, we will # hardcode the paths to SVN and Git where possible. OUTPUT="$(uname | grep 'MINGW')" MINGW=$? @@ -25,10 +39,8 @@ else fi fi -# Don't try to use Cygwin tools. Get real win32 tools using the batch script. -OUTPUT="$(uname | grep 'CYGWIN')" -CYGWIN=$? -if [ $CYGWIN = 0 ] || [ $MINGW = 0 ]; then +# We want to update the bundled tools even under MinGW. +if [ $MINGW = 0 ]; then $COMSPEC /c `cygpath -w "$base_dir/bootstrap/win/win_tools.bat"` fi