| OLD | NEW |
| 1 @echo off | 1 @echo off |
| 2 :: Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 :: Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 :: Use of this source code is governed by a BSD-style license that can be | 3 :: Use of this source code is governed by a BSD-style license that can be |
| 4 :: found in the LICENSE file. | 4 :: found in the LICENSE file. |
| 5 | 5 |
| 6 :: This script will try to find if svn and python are accessible and it not, | 6 :: This script will try to find if svn and python are accessible and it not, |
| 7 :: it will try to download it and 'install' it in depot_tools. | 7 :: it will try to download it and 'install' it in depot_tools. |
| 8 | 8 |
| 9 :: Sadly, we can't use SETLOCAL here otherwise it ERRORLEVEL is not correctly | 9 :: Sadly, we can't use SETLOCAL here otherwise it ERRORLEVEL is not correctly |
| 10 :: returned. | 10 :: returned. |
| 11 | 11 |
| 12 set WIN_TOOLS_ROOT_URL=https://src.chromium.org/svn/trunk/tools | 12 set WIN_TOOLS_ROOT_URL=https://src.chromium.org/svn/trunk/tools |
| 13 :: It used to be %~dp0 but ADODB.Stream may fail to write to this directory if | 13 :: It used to be %~dp0 but ADODB.Stream may fail to write to this directory if |
| 14 :: the directory DACL is set to elevated integrity level. | 14 :: the directory DACL is set to elevated integrity level. |
| 15 set ZIP_DIR=%TEMP% | 15 set ZIP_DIR=%TEMP% |
| 16 | 16 |
| 17 :: Get absolute root directory (.js scripts don't handle relative paths well). | 17 :: Get absolute root directory (.js scripts don't handle relative paths well). |
| 18 pushd %~dp0..\.. | 18 pushd %~dp0..\.. |
| 19 set WIN_TOOLS_ROOT_DIR=%CD% | 19 set WIN_TOOLS_ROOT_DIR=%CD% |
| 20 popd | 20 popd |
| 21 | 21 |
| 22 if "%1" == "force" ( | 22 if "%1" == "force" ( |
| 23 set WIN_TOOLS_FORCE=1 | 23 set WIN_TOOLS_FORCE=1 |
| 24 shift /1 | 24 shift /1 |
| 25 ) | 25 ) |
| 26 | 26 |
| 27 | 27 |
| 28 :GIT_CHECK | 28 :GIT_CHECK |
| 29 call ver | findstr "XP" 2>nul 1>nul |
| 30 if errorlevel 0 goto :GIT_XP_CHECK |
| 29 if "%DEPOT_TOOLS_GIT_1852%" == "0" goto :GIT_180_CHECK | 31 if "%DEPOT_TOOLS_GIT_1852%" == "0" goto :GIT_180_CHECK |
| 30 goto :GIT_1852_CHECK | 32 goto :GIT_1852_CHECK |
| 31 | 33 |
| 32 | 34 |
| 33 :GIT_1852_CHECK | 35 :GIT_1852_CHECK |
| 34 set GIT_VERSION=1.8.5.2.chromium.1 | 36 set GIT_VERSION=1.8.5.2.chromium.1 |
| 35 set GIT_BIN_DIR=git-%GIT_VERSION%_bin | 37 set GIT_BIN_DIR=git-%GIT_VERSION%_bin |
| 36 set GIT_ZIP_FILE=%GIT_BIN_DIR%.zip | 38 set GIT_ZIP_FILE=%GIT_BIN_DIR%.zip |
| 37 set GIT_ZIP_URL=https://commondatastorage.googleapis.com/chrome-infra/%GIT_ZIP_F
ILE% | 39 set GIT_ZIP_URL=https://commondatastorage.googleapis.com/chrome-infra/%GIT_ZIP_F
ILE% |
| 38 goto :GIT_COMMON | 40 goto :GIT_COMMON |
| 39 | 41 |
| 40 | 42 |
| 43 :: Our new build of git doesn't work on XP (uses newer APIs). |
| 44 :GIT_XP_CHECK |
| 45 :: If the new git was installed, remove all old git packages and reinstall the |
| 46 :: correct version from scratch. |
| 47 if exist "%WIN_TOOLS_ROOT_DIR%\git-1.8.5.2.chromium.1_bin" ( |
| 48 rmdir /S /Q "%WIN_TOOLS_ROOT_DIR%\git-1.8.5.2.chromium.1_bin" |
| 49 if exist "%WIN_TOOLS_ROOT_DIR%\git-1.8.0_bin" ( |
| 50 rmdir /S /Q "%WIN_TOOLS_ROOT_DIR%\git-1.8.0_bin" |
| 51 ) |
| 52 ) |
| 53 goto :GIT_180_CHECK |
| 54 |
| 55 |
| 41 :GIT_180_CHECK | 56 :GIT_180_CHECK |
| 42 set GIT_VERSION=1.8.0 | 57 set GIT_VERSION=1.8.0 |
| 43 set GIT_BIN_DIR=git-%GIT_VERSION%_bin | 58 set GIT_BIN_DIR=git-%GIT_VERSION%_bin |
| 44 set GIT_ZIP_FILE=%GIT_BIN_DIR%.zip | 59 set GIT_ZIP_FILE=%GIT_BIN_DIR%.zip |
| 45 set GIT_ZIP_URL=%WIN_TOOLS_ROOT_URL%/third_party/%GIT_ZIP_FILE% | 60 set GIT_ZIP_URL=%WIN_TOOLS_ROOT_URL%/third_party/%GIT_ZIP_FILE% |
| 46 goto :GIT_COMMON | 61 goto :GIT_COMMON |
| 47 | 62 |
| 48 | 63 |
| 49 :GIT_COMMON | 64 :GIT_COMMON |
| 50 :: If the batch file exists, skip the git check. | 65 :: If the batch file exists, skip the git check. |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 goto :END | 212 goto :END |
| 198 | 213 |
| 199 | 214 |
| 200 :returncode | 215 :returncode |
| 201 set WIN_TOOLS_ROOT_URL= | 216 set WIN_TOOLS_ROOT_URL= |
| 202 set WIN_TOOLS_ROOT_DIR= | 217 set WIN_TOOLS_ROOT_DIR= |
| 203 exit /b %ERRORLEVEL% | 218 exit /b %ERRORLEVEL% |
| 204 | 219 |
| 205 :END | 220 :END |
| 206 call :returncode %ERRORLEVEL% | 221 call :returncode %ERRORLEVEL% |
| OLD | NEW |