| OLD | NEW |
| 1 #!/usr/bin/env bash | 1 #!/usr/bin/env bash |
| 2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2010 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 base_dir=$(dirname "$0") | 8 base_dir=$(dirname "$0") |
| 9 if [ -L "$base_dir" ] | 9 if [ -L "$base_dir" ] |
| 10 then | 10 then |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 echo "git version is ${GITV}, please update to a version later than 1.6" | 40 echo "git version is ${GITV}, please update to a version later than 1.6" |
| 41 exit 1 | 41 exit 1 |
| 42 fi | 42 fi |
| 43 } | 43 } |
| 44 | 44 |
| 45 # Get the current SVN revision. | 45 # Get the current SVN revision. |
| 46 get_svn_revision() { | 46 get_svn_revision() { |
| 47 echo `svn info "$base_dir" | awk '{ if ($1 == "Revision:") { print $2 }}'` | 47 echo `svn info "$base_dir" | awk '{ if ($1 == "Revision:") { print $2 }}'` |
| 48 } | 48 } |
| 49 | 49 |
| 50 # Update git checkouts prior the cygwin check, we don't want to use msysgit. | 50 # Update git checkouts. |
| 51 if [ "X$DEPOT_TOOLS_UPDATE" != "X0" -a -e "$base_dir/.git" ] | 51 if [ "X$DEPOT_TOOLS_UPDATE" != "X0" -a -e "$base_dir/.git" ] |
| 52 then | 52 then |
| 53 cd $base_dir | 53 cd $base_dir |
| 54 test_git_svn | 54 test_git_svn |
| 55 # work around a git-svn --quiet bug | 55 # work around a git-svn --quiet bug |
| 56 OUTPUT=`git svn rebase -q -q` | 56 OUTPUT=`git svn rebase -q -q` |
| 57 if [[ ! "$OUTPUT" == *Current.branch* ]]; then | 57 if [[ ! "$OUTPUT" == *Current.branch* ]]; then |
| 58 echo $OUTPUT 1>&2 | 58 echo $OUTPUT 1>&2 |
| 59 fi | 59 fi |
| 60 cd - > /dev/null | 60 cd - > /dev/null |
| 61 fi | 61 fi |
| 62 | 62 |
| 63 # We're on POSIX. We can now safely look for svn checkout. | 63 # We're on POSIX. We can now safely look for svn checkout. |
| 64 if [ "X$DEPOT_TOOLS_UPDATE" != "X0" -a -e "$base_dir/.svn" ] | 64 if [ "X$DEPOT_TOOLS_UPDATE" != "X0" -a -e "$base_dir/.svn" ] |
| 65 then | 65 then |
| 66 # Update the bootstrap directory to stay up-to-date with the latest | 66 # Update the bootstrap directory to stay up-to-date with the latest |
| 67 # depot_tools. | 67 # depot_tools. |
| 68 BEFORE_REVISION=$(get_svn_revision) | 68 BEFORE_REVISION=$(get_svn_revision) |
| 69 svn -q up "$base_dir" | 69 svn -q up "$base_dir" |
| 70 AFTER_REVISION=$(get_svn_revision) | 70 AFTER_REVISION=$(get_svn_revision) |
| 71 if [[ "$BEFORE_REVISION" != "$AFTER_REVISION" ]]; then | 71 if [[ "$BEFORE_REVISION" != "$AFTER_REVISION" ]]; then |
| 72 echo "Depot Tools has been updated to revision $AFTER_REVISION." 1>&2 | 72 echo "Depot Tools has been updated to revision $AFTER_REVISION." 1>&2 |
| 73 fi | 73 fi |
| 74 fi | 74 fi |
| OLD | NEW |