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 base_dir=$(dirname "$0") | 14 base_dir=$(dirname "$0") |
15 if [ -L "$base_dir" ] | 15 if [ -L "$base_dir" ] |
16 then | 16 then |
17 base_dir=`cd "$base_dir" && pwd -P` | 17 base_dir=`cd "$base_dir" && pwd -P` |
18 fi | 18 fi |
19 | 19 |
| 20 # Don't try to use Cygwin tools. Get real win32 tools using the batch script. |
| 21 OUTPUT="$(uname | grep 'CYGWIN')" |
| 22 CYGWIN=$? |
| 23 if [ $CYGWIN = 0 ]; then |
| 24 exec cmd /c "$base_dir/bootstrap/win/win_tools.bat" force |
| 25 fi |
| 26 |
20 # Test if this script is running under a MSys install. If it is, we will | 27 # Test if this script is running under a MSys install. If it is, we will |
21 # hardcode the paths to SVN and Git where possible. | 28 # hardcode the paths to SVN and Git where possible. |
22 OUTPUT="$(uname | grep 'MINGW')" | 29 OUTPUT="$(uname | grep 'MINGW')" |
23 MINGW=$? | 30 MINGW=$? |
24 | 31 |
25 CANONICAL_GIT_URL="https://chromium.googlesource.com/chromium/tools/depot_tools.
git" | 32 CANONICAL_GIT_URL="https://chromium.googlesource.com/chromium/tools/depot_tools.
git" |
26 | 33 |
27 SVN="svn" | 34 SVN="svn" |
28 if [ -d "$base_dir/svn_bin" -a $MINGW = 0 ]; then | 35 if [ -d "$base_dir/svn_bin" -a $MINGW = 0 ]; then |
29 SVN="$base_dir/svn_bin/svn.exe" | 36 SVN="$base_dir/svn_bin/svn.exe" |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 # Update the root directory to stay up-to-date with the latest depot_tools. | 138 # Update the root directory to stay up-to-date with the latest depot_tools. |
132 BEFORE_REVISION=$(get_svn_revision) | 139 BEFORE_REVISION=$(get_svn_revision) |
133 "$SVN" -q up "$base_dir" | 140 "$SVN" -q up "$base_dir" |
134 AFTER_REVISION=$(get_svn_revision) | 141 AFTER_REVISION=$(get_svn_revision) |
135 if [[ "$BEFORE_REVISION" != "$AFTER_REVISION" ]]; then | 142 if [[ "$BEFORE_REVISION" != "$AFTER_REVISION" ]]; then |
136 echo "Depot Tools has been updated to revision $AFTER_REVISION." 1>&2 | 143 echo "Depot Tools has been updated to revision $AFTER_REVISION." 1>&2 |
137 fi | 144 fi |
138 fi | 145 fi |
139 | 146 |
140 find "$base_dir" -iname "*.pyc" -exec rm {} \; | 147 find "$base_dir" -iname "*.pyc" -exec rm {} \; |
OLD | NEW |