From 7526fe3b28d1dd1afc000a8abc02142496c74949 Mon Sep 17 00:00:00 2001 From: "scottbyer@chromium.org" Date: Wed, 20 Oct 2010 18:05:30 +0000 Subject: [PATCH] A refactoring left cygwin busted. Create an update_depot_tools.bat file to use for updated when on cygwin, and properly call it from the update_depot_tools shell script and gclient batch files. BUG=none TEST=gclient sync and git cl work again on cygwin. Can also turn echo on in update_depot_tools.bat to verify updating working correctly. Review URL: http://codereview.chromium.org/3856006 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@63234 0039d316-1c4b-4281-b951-d872f2087c98 --- bootstrap/gclient.bat | 15 ++------------- bootstrap/update_depot_tools.bat | 15 +++++++++++++++ gclient | 7 +++++++ update_depot_tools | 5 ++--- 4 files changed, 26 insertions(+), 16 deletions(-) create mode 100644 bootstrap/update_depot_tools.bat diff --git a/bootstrap/gclient.bat b/bootstrap/gclient.bat index 905192815..33cf0476a 100644 --- a/bootstrap/gclient.bat +++ b/bootstrap/gclient.bat @@ -3,19 +3,8 @@ :: Use of this source code is governed by a BSD-style license that can be :: found in the LICENSE file. -:: This batch file will try to sync the root directory and call back gclient. +:: Synchronize the root directory before deferring control back up to it. +call "%~dp0\update_depot_tools.bat" -setlocal - -:: Shall skip automatic update? -IF "%DEPOT_TOOLS_UPDATE%" == "0" GOTO :gclient - -:: We can't sync if ..\.svn\. doesn't exist. -IF NOT EXIST "%~dp0..\.svn\." GOTO :gclient - -:: Sync the .. directory to update the bootstrap at the same time. -call svn -q up "%~dp0.." - -:gclient :: Defer control. python "%~dp0\..\gclient.py" %* diff --git a/bootstrap/update_depot_tools.bat b/bootstrap/update_depot_tools.bat new file mode 100644 index 000000000..31f13391b --- /dev/null +++ b/bootstrap/update_depot_tools.bat @@ -0,0 +1,15 @@ +@echo off +:: Copyright (c) 2010 The Chromium Authors. All rights reserved. +:: Use of this source code is governed by a BSD-style license that can be +:: found in the LICENSE file. + +:: This batch file will try to sync the root directory. + +:: Shall skip automatic update? +IF "%DEPOT_TOOLS_UPDATE%" == "0" GOTO :EOF + +:: We can't sync if ..\.svn\. doesn't exist. +IF NOT EXIST "%~dp0..\.svn\." GOTO :EOF + +:: Sync the .. directory to update the bootstrap at the same time. +call svn -q up "%~dp0.." diff --git a/gclient b/gclient index 19cc68dae..1680ecd3c 100755 --- a/gclient +++ b/gclient @@ -5,6 +5,13 @@ base_dir=$(dirname "$0") +# Use the batch file as an entry point if on cygwin. Needs to happen before +# the call to update the tools or the update will happen twice. +if [ "${OSTYPE}" = "cygwin" -a "${TERM}" != "xterm" ]; then + ${base_dir}/gclient.bat "$@" + exit +fi + "$base_dir"/update_depot_tools exec python "$base_dir/gclient.py" "$@" diff --git a/update_depot_tools b/update_depot_tools index 4f896465a..5fdb6cfe7 100755 --- a/update_depot_tools +++ b/update_depot_tools @@ -54,11 +54,10 @@ fi # Use the batch file as an entry point if on cygwin. if [ "${OSTYPE}" = "cygwin" -a "${TERM}" != "xterm" ]; then - ${base_dir}/gclient.bat "$@" - exit + ${base_dir}/bootstrap/update_depot_tools.bat + exit fi - # We're on POSIX (not cygwin). We can now safely look for svn checkout. if [ "X$DEPOT_TOOLS_UPDATE" != "X0" -a -e "$base_dir/.svn" ] then