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=http://src.chromium.org/svn/trunk/tools | 12 set WIN_TOOLS_ROOT_URL=http://src.chromium.org/svn/trunk/tools |
13 set GIT_BIN_DIR=git-1.8.0_bin | 13 set GIT_BIN_DIR=git-1.8.0_bin |
14 | 14 |
15 :: Get absolute root directory (.js scripts don't handle relative paths well). | 15 :: Get absolute root directory (.js scripts don't handle relative paths well). |
16 pushd %~dp0..\.. | 16 pushd %~dp0..\.. |
17 set WIN_TOOLS_ROOT_DIR=%CD% | 17 set WIN_TOOLS_ROOT_DIR=%CD% |
18 popd | 18 popd |
19 | 19 |
20 if "%1" == "force" ( | 20 if "%1" == "force" ( |
21 set WIN_TOOLS_FORCE=1 | 21 set WIN_TOOLS_FORCE=1 |
22 shift /1 | 22 shift /1 |
23 ) | 23 ) |
24 | 24 |
25 | 25 |
26 :GIT_CHECK | 26 :GIT_CHECK |
27 :: If the batch file exists, skip the git check. | 27 :: If the batch file exists, skip the git check. |
28 if not exist "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%" goto :GIT_INSTALL | 28 if exist "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%" goto :SVN_CHECK |
29 if "%CHROME_HEADLESS%" == "1" goto :SVN_CHECK | 29 if "%CHROME_HEADLESS%" == "1" goto :SVN_CHECK |
30 if "%WIN_TOOLS_FORCE%" == "1" goto :GIT_INSTALL | 30 if "%WIN_TOOLS_FORCE%" == "1" goto :GIT_INSTALL |
31 call git --version 2>nul 1>nul | 31 call git --version 2>nul 1>nul |
32 if errorlevel 1 goto :GIT_INSTALL | 32 if errorlevel 1 goto :GIT_INSTALL |
33 goto :SVN_CHECK | 33 goto :SVN_CHECK |
34 | 34 |
35 | 35 |
36 :GIT_INSTALL | 36 :GIT_INSTALL |
37 echo Installing git (avg 1-2 min download) ... | 37 echo Installing git (avg 1-2 min download) ... |
38 :: git is not accessible; check it out and create 'proxy' files. | 38 :: git is not accessible; check it out and create 'proxy' files. |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 goto :END | 139 goto :END |
140 | 140 |
141 | 141 |
142 :returncode | 142 :returncode |
143 set WIN_TOOLS_ROOT_URL= | 143 set WIN_TOOLS_ROOT_URL= |
144 set WIN_TOOLS_ROOT_DIR= | 144 set WIN_TOOLS_ROOT_DIR= |
145 exit /b %ERRORLEVEL% | 145 exit /b %ERRORLEVEL% |
146 | 146 |
147 :END | 147 :END |
148 call :returncode %ERRORLEVEL% | 148 call :returncode %ERRORLEVEL% |
OLD | NEW |