diff --git a/README b/README index f2c262e79..2e0a58649 100644 --- a/README +++ b/README @@ -33,7 +33,7 @@ This package contains: Note: svn and python will be installed automatically if not accessible (on Windows only). -To update this distribution manually, run bootstrap\gclient.bat on Windows, -or bootstrap/gclient.sh on Linux or Mac. +To update this distribution manually, run .\update_depot_tools.bat on Windows, +or ./update_depot_tools on Linux or Mac. To disable automatic updating, set the environment variable DEPOT_TOOLS_UPDATE=0 diff --git a/bootstrap/gclient.bat b/bootstrap/gclient.bat index aff14dc56..e79c08860 100644 --- a/bootstrap/gclient.bat +++ b/bootstrap/gclient.bat @@ -1,10 +1,22 @@ @echo off -:: Copyright (c) 2009 The Chromium Authors. All rights reserved. +:: Copyright (c) 2012 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. -:: Synchronize the root directory before deferring control back up to it. -call "%~dp0\update_depot_tools.bat" +:: IMPORTANT NOTE: +:: The bootstrap flow has been removed. This file's only purpose is to make the +:: transition smooth as the previous update script called bootstrap\gclient.bat +:: The current flow took place on March 21, 2012. This file should be removed +:: when it is believed everyone has updated since then. -:: Defer control. -python "%~dp0\..\gclient.py" %* +:: At this point we know %DEPOT_TOOLS_UPDATE% != 0 as in the previous script +:: bootstrap\gclient.bat was only called if this was the case. + +:: Update the root directory. The previous version only supported svn so there +:: is no need looking for git here (i.e. if someone has git they can't get to +:: this point where the bootstrap dir is gone during the update anyways...) +IF NOT EXIST "%~dp0..\.svn\." GOTO :EOF +call svn up -q "%~dp0.." + +:: Call the updated gclient.bat in the root directory to wrap the update. +call "%~dp0..\gclient.bat" diff --git a/bootstrap/gclient.sh b/bootstrap/gclient.sh deleted file mode 100755 index 7223bd86f..000000000 --- a/bootstrap/gclient.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh -# Copyright (c) 2009 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 script will try to sync the root and bootstrap directories. - -base_dir=$(dirname "$0") - -# Skip if $DEPOT_TOOLS_UPDATE==0 or ../.svn/. doesn't exist. -if [ "X$DEPOT_TOOLS_UPDATE" != "X0" -a -e "$base_dir/../.svn" ] -then - # Update the root directory. - svn -q up "$base_dir/.." -fi - -exec python "$base_dir/../gclient.py" "$@" diff --git a/bootstrap/update_depot_tools.bat b/bootstrap/update_depot_tools.bat deleted file mode 100755 index a0aae4d23..000000000 --- a/bootstrap/update_depot_tools.bat +++ /dev/null @@ -1,15 +0,0 @@ -@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.bat b/gclient.bat index 686090396..e8cbba61c 100755 --- a/gclient.bat +++ b/gclient.bat @@ -1,43 +1,10 @@ @echo off -:: Copyright (c) 2009 The Chromium Authors. All rights reserved. +:: Copyright (c) 2012 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 file is a stub to sync .\bootstrap first and defer control to -:: .\bootstrap\gclient.bat, which will sync back '.'. This is unless auto -:: update is disabled, were gclient.py is directly called. -setlocal +:: Synchronize the root directory before deferring control back to gclient.py. +call "%~dp0\update_depot_tools.bat" -:: This is required with cygwin only. -PATH=%~dp0;%PATH% - -:: Will download svn and python. -:: If you don't want to install the depot_tools version of these tools, remove -:: the 'force' option on the next command. The tools won't be installed only if -:: not already in the PATH environment variable. -call "%~dp0bootstrap\win\win_tools.bat" force -if errorlevel 1 goto :EOF - -:: Shall skip automatic update? -IF "%DEPOT_TOOLS_UPDATE%" == "0" GOTO :SKIP_UPDATE -:: We can't sync if .\.svn\. doesn't exist. -IF NOT EXIST "%~dp0.svn\." GOTO :SKIP_UPDATE - -:: Sync the bootstrap directory. -call svn up -q "%~dp0bootstrap" -:: still continue even in case of error. -goto :UPDATE - - -:SKIP_UPDATE -:: Don't bother to try to update any thing. +:: Defer control. python "%~dp0\gclient.py" %* -goto :EOF - - -:UPDATE -:: Transfer control to ease the update process. The following lines won't be -:: executed so don't add any! Specifically, don't use 'call' in the following -:: line. -"%~dp0bootstrap\gclient.bat" %* -goto :EOF diff --git a/update_depot_tools b/update_depot_tools index 203e08414..00859e338 100755 --- a/update_depot_tools +++ b/update_depot_tools @@ -85,8 +85,7 @@ fi # We're on POSIX. We can now safely look for svn checkout. if [ "X$DEPOT_TOOLS_UPDATE" != "X0" -a -e "$base_dir/.svn" ] then - # Update the bootstrap directory to stay up-to-date with the latest - # depot_tools. + # Update the root directory to stay up-to-date with the latest depot_tools. BEFORE_REVISION=$(get_svn_revision) "$SVN" -q up "$base_dir" AFTER_REVISION=$(get_svn_revision) diff --git a/update_depot_tools.bat b/update_depot_tools.bat new file mode 100644 index 000000000..990ea31ee --- /dev/null +++ b/update_depot_tools.bat @@ -0,0 +1,35 @@ +@echo off +:: Copyright (c) 2012 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. + +setlocal + +:: Will download svn and python. +:: If you don't want to install the depot_tools version of these tools, remove +:: the 'force' option on the next command. The tools will be installed only if +:: not already in the PATH environment variable. +call "%~dp0bootstrap\win\win_tools.bat" force +if errorlevel 1 goto :EOF + +:: Shall skip automatic update? +IF "%DEPOT_TOOLS_UPDATE%" == "0" GOTO :EOF + +:: We need either .\.svn\. or .\.git\. to be able to sync. +IF EXIST "%~dp0.svn\." GOTO :SVN_UPDATE +IF EXIST "%~dp0.git\." GOTO :GIT_UPDATE +echo Error updating depot_tools, no revision tool found. +goto :EOF + + +:SVN_UPDATE +call svn up -q "%~dp0." +goto :EOF + + +:GIT_UPDATE +cd /d "%~dp0." +call git svn rebase -q -q +goto :EOF