blob: 3705f0b3978b911f7e32188ae9a98a4cab0aa024 [file] [log] [blame]
maruel@google.comfb2b8eb2009-04-23 21:03:42 +00001#!/bin/sh
2# Copyright (c) 2009 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
8base_dir=$(dirname "$0")
maruel@chromium.org522ca092009-06-17 18:35:18 +00009
10# Update git checkouts prior the cygwin check, we don't want to use msysgit.
11if [ "X$DEPOT_TOOLS_UPDATE" != "X0" -a -e "$base_dir/.git" ]
12then
13 (cd "$base_dir"; git svn fetch -q; git merge trunk -q)
14fi
15
16if [ "X$DEPOT_TOOLS_UPDATE" != "X0" -a -e "$base_dir/git-cl-repo/.git" ]
17then
18 (cd "$base_dir/git-cl-repo"; git pull -q)
19fi
20
21if [ "X$DEPOT_TOOLS_UPDATE" != "X0" -a -e "$base_dir/git-try-repo/.git" ]
22then
23 (cd "$base_dir/git-try-repo"; git pull -q)
24fi
25
26
maruel@chromium.orgcf1e53b2009-05-07 02:56:13 +000027# Use the batch file as an entry point if on cygwin.
maruel@chromium.org775a79c2009-06-17 13:10:48 +000028if [ "${OSTYPE}" = "cygwin" -a "${TERM}" = "cygwin" ]; then
maruel@chromium.orgbeffe122009-06-09 20:28:23 +000029 ${base_dir}/gclient.bat "$@"
maruel@chromium.orgcf1e53b2009-05-07 02:56:13 +000030 exit
31fi
32
maruel@google.comfb2b8eb2009-04-23 21:03:42 +000033
maruel@chromium.org522ca092009-06-17 18:35:18 +000034# We're on POSIX (not cygwin). We can now safely look for svn checkout.
maruel@google.comfb2b8eb2009-04-23 21:03:42 +000035if [ "X$DEPOT_TOOLS_UPDATE" != "X0" -a -e "$base_dir/.svn" ]
36then
37 # Update the bootstrap directory to stay up-to-date with the latest
38 # depot_tools.
maruel@chromium.org522ca092009-06-17 18:35:18 +000039 svn -q up "$base_dir"
maruel@chromium.org0a3488a2009-06-17 18:03:50 +000040fi
maruel@chromium.org522ca092009-06-17 18:35:18 +000041
42exec python "$base_dir/gclient.py" "$@"