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. |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 cd $base_dir | 133 cd $base_dir |
134 update_git_repo | 134 update_git_repo |
135 cd - > /dev/null | 135 cd - > /dev/null |
136 fi | 136 fi |
137 | 137 |
138 # We're on POSIX. We can now safely look for svn checkout. | 138 # We're on POSIX. We can now safely look for svn checkout. |
139 if [ "X$DEPOT_TOOLS_UPDATE" != "X0" -a -e "$base_dir/.svn" ] | 139 if [ "X$DEPOT_TOOLS_UPDATE" != "X0" -a -e "$base_dir/.svn" ] |
140 then | 140 then |
141 # Update the root directory to stay up-to-date with the latest depot_tools. | 141 # Update the root directory to stay up-to-date with the latest depot_tools. |
142 BEFORE_REVISION=$(get_svn_revision) | 142 BEFORE_REVISION=$(get_svn_revision) |
143 if [[ $* =~ '--force' ]]; then | 143 if echo $* | grep "--force" > /dev/null; then |
144 "$SVN" -q revert -R "$base_dir" | 144 "$SVN" -q revert -R "$base_dir" |
145 fi | 145 fi |
146 "$SVN" -q up "$base_dir" | 146 "$SVN" -q up "$base_dir" |
147 AFTER_REVISION=$(get_svn_revision) | 147 AFTER_REVISION=$(get_svn_revision) |
148 if [[ "$BEFORE_REVISION" != "$AFTER_REVISION" ]]; then | 148 if [[ "$BEFORE_REVISION" != "$AFTER_REVISION" ]]; then |
149 echo "Depot Tools has been updated to revision $AFTER_REVISION." 1>&2 | 149 echo "Depot Tools has been updated to revision $AFTER_REVISION." 1>&2 |
150 fi | 150 fi |
151 fi | 151 fi |
152 | 152 |
153 find "$base_dir" -iname "*.pyc" -exec rm {} \; | 153 find "$base_dir" -iname "*.pyc" -exec rm {} \; |
OLD | NEW |