Commit 83f4767a authored by szager@chromium.org's avatar szager@chromium.org

Update to git-1.9.0.

Also, allow multiple git installations to exist side-by-side.
This makes it easier to revert back to an old version quickly.

BUG=
R=maruel@chromium.org

Review URL: https://codereview.chromium.org/203463004

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@258058 0039d316-1c4b-4281-b951-d872f2087c98
parent 7e8c19df
...@@ -60,21 +60,30 @@ goto :END ...@@ -60,21 +60,30 @@ goto :END
:GIT_CHECK :GIT_CHECK
if "%DEPOT_TOOLS_GIT_1852%" == "0" goto :GIT_1852_UNINSTALL goto :GIT_190_CHECK
goto :GIT_1852_CHECK
:GIT_190_CHECK
if "%DEPOT_TOOLS_GIT_190%" == "0" goto :GIT_1852_CHECK
set GIT_VERSION=1.9.0.chromium.1
set GIT_BIN_DIR=git-%GIT_VERSION%_bin
set GIT_ZIP_FILE=%GIT_BIN_DIR%.zip
set GIT_ZIP_URL=https://commondatastorage.googleapis.com/chrome-infra/%GIT_ZIP_FILE%
goto :GIT_COMMON
:GIT_1852_CHECK :GIT_1852_CHECK
if "%DEPOT_TOOLS_GIT_1852%" == "0" goto :GIT_180_CHECK
set GIT_VERSION=1.8.5.2.chromium.1 set GIT_VERSION=1.8.5.2.chromium.1
set GIT_BIN_DIR=git-%GIT_VERSION%_bin
set GIT_ZIP_FILE=%GIT_BIN_DIR%.zip
set GIT_ZIP_URL=https://commondatastorage.googleapis.com/chrome-infra/%GIT_ZIP_FILE%
:: This git uses APIs that target WINVER 0x0502, so refuse to install it on :: This git uses APIs that target WINVER 0x0502, so refuse to install it on
:: anything older. :: anything older.
for /f "tokens=2 delims=[]" %%i in ('ver') do set VERSTR=%%i for /f "tokens=2 delims=[]" %%i in ('ver') do set VERSTR=%%i
for /f "tokens=2,3 delims=. " %%i in ("%VERSTR%") do (set VERMAJOR=%%i & set VERMINOR=%%j) for /f "tokens=2,3 delims=. " %%i in ("%VERSTR%") do (set VERMAJOR=%%i & set VERMINOR=%%j)
if %VERMAJOR% lss 5 goto :GIT_VER_UNSUPPORTED if %VERMAJOR% lss 5 goto :GIT_VER_UNSUPPORTED
if %VERMAJOR% equ 5 if %VERMINOR% lss 2 goto :GIT_VER_UNSUPPORTED if %VERMAJOR% equ 5 if %VERMINOR% lss 2 goto :GIT_VER_UNSUPPORTED
set GIT_BIN_DIR=git-%GIT_VERSION%_bin
set GIT_ZIP_FILE=%GIT_BIN_DIR%.zip
set GIT_ZIP_URL=https://commondatastorage.googleapis.com/chrome-infra/%GIT_ZIP_FILE%
goto :GIT_COMMON goto :GIT_COMMON
...@@ -84,18 +93,6 @@ ver ...@@ -84,18 +93,6 @@ ver
goto :GIT_180_CHECK goto :GIT_180_CHECK
:GIT_1852_UNINSTALL
:: If the new git was installed, remove all installed git packages to trigger
:: reinstallation of the old version.
if exist "%WIN_TOOLS_ROOT_DIR%\git-1.8.5.2.chromium.1_bin" (
rmdir /S /Q "%WIN_TOOLS_ROOT_DIR%\git-1.8.5.2.chromium.1_bin"
if exist "%WIN_TOOLS_ROOT_DIR%\git-1.8.0_bin" (
rmdir /S /Q "%WIN_TOOLS_ROOT_DIR%\git-1.8.0_bin"
)
)
goto :GIT_180_CHECK
:GIT_180_CHECK :GIT_180_CHECK
set GIT_VERSION=1.8.0 set GIT_VERSION=1.8.0
set GIT_BIN_DIR=git-%GIT_VERSION%_bin set GIT_BIN_DIR=git-%GIT_VERSION%_bin
...@@ -105,18 +102,17 @@ goto :GIT_COMMON ...@@ -105,18 +102,17 @@ goto :GIT_COMMON
:GIT_COMMON :GIT_COMMON
:: If the batch file exists, skip the git check.
if exist "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%" goto :MSYS_PATH_CHECK
if "%WIN_TOOLS_FORCE%" == "1" goto :GIT_INSTALL if "%WIN_TOOLS_FORCE%" == "1" goto :GIT_INSTALL
call git --version 2>nul 1>nul if exist "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\cmd\git.cmd" (
if errorlevel 1 goto :GIT_INSTALL call "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\cmd\git.cmd" --version 2>nul 1>nul
goto :SVN_CHECK if errorlevel 1 goto :GIT_INSTALL
rem Several git versions can live side-by-side; check the top-level
rem batch script to make sure it points to the desired version.
:MSYS_PATH_CHECK find "%GIT_BIN_DIR%" "%WIN_TOOLS_ROOT_DIR%\git.bat" 2>nul 1>nul
call find "mingw" "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\cmd\git.cmd" 2>nul 1>nul if errorlevel 1 goto :GIT_COPY_BATCH_FILES
if errorlevel 1 goto :SVN_CHECK goto :SVN_CHECK
rmdir /S /Q "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%" )
goto :GIT_INSTALL
:GIT_INSTALL :GIT_INSTALL
...@@ -133,14 +129,18 @@ cscript //nologo //e:jscript "%~dp0unzip.js" "%ZIP_DIR%\git.zip" "%WIN_TOOLS_ROO ...@@ -133,14 +129,18 @@ cscript //nologo //e:jscript "%~dp0unzip.js" "%ZIP_DIR%\git.zip" "%WIN_TOOLS_ROO
if errorlevel 1 goto :GIT_FAIL if errorlevel 1 goto :GIT_FAIL
if not exist "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\." goto :GIT_FAIL if not exist "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\." goto :GIT_FAIL
del "%ZIP_DIR%\git.zip" del "%ZIP_DIR%\git.zip"
:: Ensure autocrlf and filemode are set correctly.
call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --system core.autocrlf false
call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --system core.filemode false
goto :GIT_COPY_BATCH_FILES
:GIT_COPY_BATCH_FILES
:: Create the batch files. :: Create the batch files.
call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\git.bat" "%WIN_TOOLS_ROOT_DIR%\git.bat" 1>nul call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\git.bat" "%WIN_TOOLS_ROOT_DIR%\git.bat" 1>nul
call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\gitk.bat" "%WIN_TOOLS_ROOT_DIR%\gitk.bat" 1>nul call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\gitk.bat" "%WIN_TOOLS_ROOT_DIR%\gitk.bat" 1>nul
call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\ssh.bat" "%WIN_TOOLS_ROOT_DIR%\ssh.bat" 1>nul call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\ssh.bat" "%WIN_TOOLS_ROOT_DIR%\ssh.bat" 1>nul
call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\ssh-keygen.bat" "%WIN_TOOLS_ROOT_DIR%\ssh-keygen.bat" 1>nul call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\ssh-keygen.bat" "%WIN_TOOLS_ROOT_DIR%\ssh-keygen.bat" 1>nul
:: Ensure autocrlf and filemode are set correctly.
call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --global core.autocrlf false
call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --global core.filemode false
goto :SVN_CHECK goto :SVN_CHECK
......
...@@ -29,7 +29,7 @@ fi ...@@ -29,7 +29,7 @@ fi
OUTPUT="$(uname | grep 'CYGWIN')" OUTPUT="$(uname | grep 'CYGWIN')"
CYGWIN=$? CYGWIN=$?
if [ $CYGWIN = 0 ]; then if [ $CYGWIN = 0 ]; then
cmd /c `cygpath -w "$base_dir/bootstrap/win/win_tools.bat"` force cmd /c `cygpath -w "$base_dir/bootstrap/win/win_tools.bat"`
fi fi
CANONICAL_GIT_URL="https://chromium.googlesource.com/chromium/tools/depot_tools.git" CANONICAL_GIT_URL="https://chromium.googlesource.com/chromium/tools/depot_tools.git"
......
...@@ -21,11 +21,8 @@ SHIFT ...@@ -21,11 +21,8 @@ SHIFT
set GIT_URL=https://chromium.googlesource.com/chromium/tools/depot_tools.git set GIT_URL=https://chromium.googlesource.com/chromium/tools/depot_tools.git
:: Will download svn and python. :: Will download git, svn and python.
:: If you don't want to install the depot_tools version of these tools, remove call "%DEPOT_TOOLS_DIR%bootstrap\win\win_tools.bat"
:: the 'force' option on the next command. The tools will be installed only if
:: not already in the PATH environment variable.
call "%DEPOT_TOOLS_DIR%bootstrap\win\win_tools.bat" force
if errorlevel 1 goto :EOF if errorlevel 1 goto :EOF
:: Now clear errorlevel so it can be set by other programs later. :: Now clear errorlevel so it can be set by other programs later.
set errorlevel= set errorlevel=
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment