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

Unified Diff: bootstrap/win/win_tools.bat

Issue 160033002: Better restriction to prevent Windows git install on XP or older. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bootstrap/win/win_tools.bat
===================================================================
--- bootstrap/win/win_tools.bat (revision 250415)
+++ bootstrap/win/win_tools.bat (working copy)
@@ -35,12 +35,24 @@
:GIT_1852_CHECK
set GIT_VERSION=1.8.5.2.chromium.1
+:: This git uses APIs that target WINVER 0x0502, so refuse to install it on
+:: anything older.
+for /f "tokens=2 delims=[]" %%i in ('ver') do set VERSTR=%%i
M-A Ruel 2014/02/11 20:11:13 Somewhat rubberstamp, it's been a long time since
Michael Moss 2014/02/11 20:14:22 Yeah, me too, and I have no idea if this is the be
+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% 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
+:GIT_VER_UNSUPPORTED
+echo Git %GIT_VERSION% cannot be installed on:
+ver
+goto :GIT_180_CHECK
+
+
:GIT_180_FORCE
:: If the new git was installed, remove all installed git packages to trigger
:: reinstallation of the old version.
@@ -64,7 +76,6 @@
: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 "%CHROME_HEADLESS%" == "1" goto :SVN_CHECK
if "%WIN_TOOLS_FORCE%" == "1" goto :GIT_INSTALL
call git --version 2>nul 1>nul
if errorlevel 1 goto :GIT_INSTALL
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698