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 | 9 |
10 # Test git and git --version. | 10 # Test git and git --version. |
(...skipping 20 matching lines...) Expand all Loading... | |
31 | 31 |
32 GITV="${GITV#* version }" # git svn --version has extra output to remove. | 32 GITV="${GITV#* version }" # git svn --version has extra output to remove. |
33 GITV="${GITV% (svn*}" | 33 GITV="${GITV% (svn*}" |
34 local GITD=( ${GITV//./ } ) # Split version number into decimals | 34 local GITD=( ${GITV//./ } ) # Split version number into decimals |
35 if ((GITD[0] < 1 || (GITD[0] == 1 && GITD[1] < 6) )); then | 35 if ((GITD[0] < 1 || (GITD[0] == 1 && GITD[1] < 6) )); then |
36 echo "git version is ${GITV}, please update to a version later than 1.6" | 36 echo "git version is ${GITV}, please update to a version later than 1.6" |
37 exit 1 | 37 exit 1 |
38 fi | 38 fi |
39 } | 39 } |
40 | 40 |
41 # Get the current SVN revision. | |
42 get_svn_revision() { | |
43 echo `svn info | awk '{ if ($1 == "Revision:") { print $2 }}'` | |
44 } | |
41 | 45 |
42 # Update git checkouts prior the cygwin check, we don't want to use msysgit. | 46 # Update git checkouts prior the cygwin check, we don't want to use msysgit. |
43 if [ "X$DEPOT_TOOLS_UPDATE" != "X0" -a -e "$base_dir/.git" ] | 47 if [ "X$DEPOT_TOOLS_UPDATE" != "X0" -a -e "$base_dir/.git" ] |
44 then | 48 then |
45 cd $base_dir | 49 cd $base_dir |
46 test_git_svn | 50 test_git_svn |
47 # work around a git-svn --quiet bug | 51 # work around a git-svn --quiet bug |
48 OUTPUT=`git svn rebase -q -q` | 52 OUTPUT=`git svn rebase -q -q` |
49 if [[ ! "$OUTPUT" == *Current.branch* ]]; then | 53 if [[ ! "$OUTPUT" == *Current.branch* ]]; then |
50 echo $OUTPUT | 54 echo $OUTPUT |
51 fi | 55 fi |
52 cd - > /dev/null | 56 cd - > /dev/null |
53 fi | 57 fi |
54 | 58 |
55 # We're on POSIX. We can now safely look for svn checkout. | 59 # We're on POSIX. We can now safely look for svn checkout. |
56 if [ "X$DEPOT_TOOLS_UPDATE" != "X0" -a -e "$base_dir/.svn" ] | 60 if [ "X$DEPOT_TOOLS_UPDATE" != "X0" -a -e "$base_dir/.svn" ] |
57 then | 61 then |
58 # Update the bootstrap directory to stay up-to-date with the latest | 62 # Update the bootstrap directory to stay up-to-date with the latest |
59 # depot_tools. | 63 # depot_tools. |
64 BEFORE_REVISION=$(get_svn_revision) | |
60 svn -q up "$base_dir" | 65 svn -q up "$base_dir" |
66 AFTER_REVISION=$(get_svn_revision) | |
67 if [[ "$BEFORE_REVISION" != "$AFTER_REVISION" ]]; then | |
M-A Ruel
2011/03/14 00:42:48
you could use?
if [ ! "$BEFORE_REVISION"=="$AFTER
| |
68 echo "Depot Tools has been updated to revision $AFTER_REVISION." | |
69 fi | |
61 fi | 70 fi |
OLD | NEW |