Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: update_depot_tools

Issue 3817011: Isolate depot_tools update into a separate script. (Closed)
Patch Set: Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « git-cl ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/bin/bash
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
4 # found in the LICENSE file.
5
6 # This script will try to sync the bootstrap directories and then defer control.
7
8 base_dir=$(dirname "$0")
9
10 # Test git and git --version.
11 function test_git {
12 local GITV="$(git --version)" || {
13 echo "git isn't installed, please install it"
14 exit 1
15 }
16
17 GITV="${GITV##* }" # Only examine last word (i.e. version number)
18 local GITD=( ${GITV//./ } ) # Split version number into decimals
19 if ((GITD[0] < 1 || (GITD[0] == 1 && GITD[1] < 6) )); then
20 echo "git version is ${GITV}, please update to a version later than 1.6"
21 exit 1
22 fi
23 }
24
25 # Test git svn and git svn --version.
26 function test_git_svn {
27 local GITV="$(git svn --version)" || {
28 echo "git-svn isn't installed, please install it"
29 exit 1
30 }
31
32 GITV="${GITV#* version }" # git svn --version has extra output to remove.
33 GITV="${GITV% (svn*}"
34 local GITD=( ${GITV//./ } ) # Split version number into decimals
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"
37 exit 1
38 fi
39 }
40
41
42 # 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" ]
44 then
45 cd $base_dir
46 test_git_svn
47 # work around a git-svn --quiet bug
48 OUTPUT=`git svn rebase -q -q`
49 if [[ ! "$OUTPUT" =~ Current.branch ]]; then
50 echo $OUTPUT
51 fi
52 cd - > /dev/null
53 fi
54
55 # Use the batch file as an entry point if on cygwin.
56 if [ "${OSTYPE}" = "cygwin" -a "${TERM}" != "xterm" ]; then
57 ${base_dir}/gclient.bat "$@"
58 exit
59 fi
60
61
62 # We're on POSIX (not cygwin). We can now safely look for svn checkout.
63 if [ "X$DEPOT_TOOLS_UPDATE" != "X0" -a -e "$base_dir/.svn" ]
64 then
65 # Update the bootstrap directory to stay up-to-date with the latest
66 # depot_tools.
67 svn -q up "$base_dir"
68 fi
OLDNEW
« no previous file with comments | « git-cl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698