OLD | NEW |
1 #!/usr/bin/env bash | 1 #!/usr/bin/env bash |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 # This script will try to sync the bootstrap directories and then defer control. | 6 # This script will try to sync the bootstrap directories and then defer control. |
7 | 7 |
8 if [ "$USER" == "root" ]; | 8 if [ "$USER" == "root" ]; |
9 then | 9 then |
10 echo Running depot tools as root is sad. | 10 echo Running depot tools as root is sad. |
11 exit | 11 exit |
12 fi | 12 fi |
13 | 13 |
14 # Test if this script is running under a MSys install. If it is, we will | 14 # Test if this script is running under a MSYS install. This is likely an error |
| 15 # if it is, so we warn the user accordingly. |
| 16 OUTPUT="$(uname | grep 'MSYS')" |
| 17 MSYS=$? |
| 18 if [ $MSYS = 0 ]; then |
| 19 echo 'WARNING: It looks like you are running these tools from an MSYS shell' |
| 20 echo '(as opposed to a MinGW shell). This shell is not supported and may' |
| 21 echo 'fail in mysterious ways.' |
| 22 echo |
| 23 echo 'To run the supported MinGW shell, use `git bash`, or use `bin/bash.exe`' |
| 24 echo 'in your MinGW installation, as opposed to `usr/bin/bash.exe`.' |
| 25 echo |
| 26 fi |
| 27 |
| 28 # Test if this script is running under a MinGW install. If it is, we will |
15 # hardcode the paths to SVN and Git where possible. | 29 # hardcode the paths to SVN and Git where possible. |
16 OUTPUT="$(uname | grep 'MINGW')" | 30 OUTPUT="$(uname | grep 'MINGW')" |
17 MINGW=$? | 31 MINGW=$? |
18 | 32 |
19 if [ $MINGW = 0 ]; then | 33 if [ $MINGW = 0 ]; then |
20 base_dir="${0%/*}" | 34 base_dir="${0%/*}" |
21 else | 35 else |
22 base_dir=$(dirname "$0") | 36 base_dir=$(dirname "$0") |
23 if [ -L "$base_dir" ]; then | 37 if [ -L "$base_dir" ]; then |
24 base_dir=`cd "$base_dir" && pwd -P` | 38 base_dir=`cd "$base_dir" && pwd -P` |
25 fi | 39 fi |
26 fi | 40 fi |
27 | 41 |
28 # Don't try to use Cygwin tools. Get real win32 tools using the batch script. | 42 # We want to update the bundled tools even under MinGW. |
29 OUTPUT="$(uname | grep 'CYGWIN')" | 43 if [ $MINGW = 0 ]; then |
30 CYGWIN=$? | |
31 if [ $CYGWIN = 0 ] || [ $MINGW = 0 ]; then | |
32 $COMSPEC /c `cygpath -w "$base_dir/bootstrap/win/win_tools.bat"` | 44 $COMSPEC /c `cygpath -w "$base_dir/bootstrap/win/win_tools.bat"` |
33 fi | 45 fi |
34 | 46 |
35 CANONICAL_GIT_URL="https://chromium.googlesource.com/chromium/tools/depot_tools.
git" | 47 CANONICAL_GIT_URL="https://chromium.googlesource.com/chromium/tools/depot_tools.
git" |
36 | 48 |
37 SVN="svn" | 49 SVN="svn" |
38 if [ -d "$base_dir/svn_bin" -a $MINGW = 0 ]; then | 50 if [ -d "$base_dir/svn_bin" -a $MINGW = 0 ]; then |
39 SVN="$base_dir/svn_bin/svn.exe" | 51 SVN="$base_dir/svn_bin/svn.exe" |
40 fi | 52 fi |
41 | 53 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 "$SVN" -q up "$base_dir" | 158 "$SVN" -q up "$base_dir" |
147 AFTER_REVISION=$(get_svn_revision) | 159 AFTER_REVISION=$(get_svn_revision) |
148 if [[ "$BEFORE_REVISION" != "$AFTER_REVISION" ]]; then | 160 if [[ "$BEFORE_REVISION" != "$AFTER_REVISION" ]]; then |
149 if [ -z "$DEPOT_TOOLS_HIDE_UPDATED_MESSAGE" ]; then | 161 if [ -z "$DEPOT_TOOLS_HIDE_UPDATED_MESSAGE" ]; then |
150 echo "Depot Tools has been updated to revision $AFTER_REVISION." 1>&2 | 162 echo "Depot Tools has been updated to revision $AFTER_REVISION." 1>&2 |
151 fi | 163 fi |
152 fi | 164 fi |
153 fi | 165 fi |
154 | 166 |
155 find "$base_dir" -iname "*.pyc" -exec rm -f {} \; | 167 find "$base_dir" -iname "*.pyc" -exec rm -f {} \; |
OLD | NEW |