Chromium Code Reviews| Index: update_depot_tools |
| diff --git a/update_depot_tools b/update_depot_tools |
| index d8b1b7feb8e6e876a9b4b9597a1dde83af59faa1..411812a0dd9ecdfa38585cfcc3cca719e6b05776 100755 |
| --- a/update_depot_tools |
| +++ b/update_depot_tools |
| @@ -17,9 +17,19 @@ then |
| base_dir=`cd "$base_dir" && pwd -P` |
| fi |
| +SVN="svn" |
| +if [ -d "$base_dir/svn_bin" ]; then |
| + SVN="$base_dir/svn_bin/svn" |
|
nsylvain
2011/05/22 21:09:54
svn.exe?
cmp
2011/05/23 22:49:05
Done.
|
| +fi |
| + |
| +GIT="git" |
| +if [ -d "$base_dir/git_bin" ]; then |
| + GIT="$base_dir/git_bin/bin/git" |
|
nsylvain
2011/05/22 21:09:54
git.exe
cmp
2011/05/23 22:49:05
Done.
|
| +fi |
| + |
| # Test git and git --version. |
| function test_git { |
| - local GITV="$(git --version)" || { |
| + local GITV="$("$GIT" --version)" || { |
| echo "git isn't installed, please install it" |
| exit 1 |
| } |
| @@ -34,7 +44,7 @@ function test_git { |
| # Test git svn and git svn --version. |
| function test_git_svn { |
| - local GITV="$(git svn --version)" || { |
| + local GITV="$("$GIT" svn --version)" || { |
| echo "git-svn isn't installed, please install it" |
| exit 1 |
| } |
| @@ -50,7 +60,7 @@ function test_git_svn { |
| # Get the current SVN revision. |
| get_svn_revision() { |
| - LANGUAGE=C svn info "$base_dir" | \ |
| + LANGUAGE=C "$SVN" info "$base_dir" | \ |
| awk -F': ' '{ if ($1 == "Last Changed Rev") { print $2 }}' |
| } |
| @@ -60,7 +70,7 @@ then |
| cd $base_dir |
| test_git_svn |
| # work around a git-svn --quiet bug |
| - OUTPUT=`git svn rebase -q -q` |
| + OUTPUT=`"$GIT" svn rebase -q -q` |
| if [[ ! "$OUTPUT" == *Current.branch* ]]; then |
| echo $OUTPUT 1>&2 |
| fi |
| @@ -73,7 +83,7 @@ then |
| # Update the bootstrap directory to stay up-to-date with the latest |
| # depot_tools. |
| BEFORE_REVISION=$(get_svn_revision) |
| - svn -q up "$base_dir" |
| + "$SVN" -q up "$base_dir" |
| AFTER_REVISION=$(get_svn_revision) |
| if [[ "$BEFORE_REVISION" != "$AFTER_REVISION" ]]; then |
| echo "Depot Tools has been updated to revision $AFTER_REVISION." 1>&2 |