| 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 # Test if this script is running under a MSys install. If it is, we will | 20 # 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. | 21 # hardcode the paths to SVN and Git where possible. |
| 22 OUTPUT="$(uname | grep 'MINGW')" | 22 OUTPUT="$(uname | grep 'MINGW')" |
| 23 MINGW=$? | 23 MINGW=$? |
| 24 | 24 |
| 25 CANONICAL_GIT_URL="https://chromium.googlesource.com/chromium/tools/depot_tools" | 25 CANONICAL_GIT_URL="https://chromium.googlesource.com/chromium/tools/depot_tools.
git" |
| 26 | 26 |
| 27 SVN="svn" | 27 SVN="svn" |
| 28 if [ -d "$base_dir/svn_bin" -a $MINGW = 0 ]; then | 28 if [ -d "$base_dir/svn_bin" -a $MINGW = 0 ]; then |
| 29 SVN="$base_dir/svn_bin/svn.exe" | 29 SVN="$base_dir/svn_bin/svn.exe" |
| 30 fi | 30 fi |
| 31 | 31 |
| 32 GIT="git" | 32 GIT="git" |
| 33 if [ -d "$base_dir/git_bin" -a $MINGW = 0 ]; then | 33 if [ -d "$base_dir/git_bin" -a $MINGW = 0 ]; then |
| 34 GIT="$base_dir/git_bin/bin/git.exe" | 34 GIT="$base_dir/git_bin/bin/git.exe" |
| 35 fi | 35 fi |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 # Update the root directory to stay up-to-date with the latest depot_tools. | 130 # Update the root directory to stay up-to-date with the latest depot_tools. |
| 131 BEFORE_REVISION=$(get_svn_revision) | 131 BEFORE_REVISION=$(get_svn_revision) |
| 132 "$SVN" -q up "$base_dir" | 132 "$SVN" -q up "$base_dir" |
| 133 AFTER_REVISION=$(get_svn_revision) | 133 AFTER_REVISION=$(get_svn_revision) |
| 134 if [[ "$BEFORE_REVISION" != "$AFTER_REVISION" ]]; then | 134 if [[ "$BEFORE_REVISION" != "$AFTER_REVISION" ]]; then |
| 135 echo "Depot Tools has been updated to revision $AFTER_REVISION." 1>&2 | 135 echo "Depot Tools has been updated to revision $AFTER_REVISION." 1>&2 |
| 136 fi | 136 fi |
| 137 fi | 137 fi |
| 138 | 138 |
| 139 find "$base_dir" -iname "*.pyc" -exec rm {} \; | 139 find "$base_dir" -iname "*.pyc" -exec rm {} \; |
| OLD | NEW |