Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 @echo off | 1 @echo off |
| 2 :: Copyright (c) 2009 The Chromium Authors. All rights reserved. | 2 :: Copyright (c) 2011 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 | 13 |
| 14 :: Get absolute root directory (.js scripts don't handle relative paths well). | 14 :: Get absolute root directory (.js scripts don't handle relative paths well). |
| 15 pushd %~dp0..\.. | 15 pushd %~dp0..\.. |
| 16 set WIN_TOOLS_ROOT_DIR=%CD% | 16 set WIN_TOOLS_ROOT_DIR=%CD% |
| 17 popd | 17 popd |
| 18 | 18 |
| 19 if "%1" == "force" ( | 19 if "%1" == "force" ( |
| 20 set WIN_TOOLS_FORCE=1 | 20 set WIN_TOOLS_FORCE=1 |
| 21 shift /1 | 21 shift /1 |
| 22 ) | 22 ) |
| 23 | 23 |
| 24 | |
| 25 :GIT_CHECK | |
| 26 :: If the batch file exists, skip the git check. | |
| 27 if exist "%WIN_TOOLS_ROOT_DIR%\git.bat" goto :SVN_CHECK | |
| 28 if "%GIT_TOOLS_FORCE%" == "1" goto :GIT_INSTALL | |
| 29 @rem call git --version 2>nul 1>nul | |
|
M-A Ruel
2011/05/16 19:26:02
Use ":: call git ..." instead of "@rem call git ..
cmp
2011/05/16 19:39:41
Done. I removed lines 29-30 and replaced with a :
| |
| 30 @rem if errorlevel 1 goto :GIT_INSTALL | |
| 31 goto :SVN_CHECK | |
| 32 | |
| 33 | |
| 34 :GIT_INSTALL | |
| 35 echo Installing git ... | |
| 36 :: git is not accessible; check it out and create 'proxy' files. | |
| 37 if exist "%~dp0git.zip" del "%~dp0git.zip" | |
| 38 cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/git_bin.zip "%~dp0git.zip" | |
| 39 if errorlevel 1 goto :GIT_FAIL | |
| 40 :: Cleanup svn directory if it was existing. | |
| 41 if exist "%WIN_TOOLS_ROOT_DIR%\git\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\git" | |
| 42 if exist "%WIN_TOOLS_ROOT_DIR%\git_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\git_bin " | |
| 43 :: Will create git_bin\... | |
| 44 cscript //nologo //e:jscript "%~dp0unzip.js" "%~dp0git.zip" "%WIN_TOOLS_ROOT_DIR %" | |
| 45 if errorlevel 1 goto :GIT_FAIL | |
| 46 if not exist "%WIN_TOOLS_ROOT_DIR%\git_bin\." goto :GIT_FAIL | |
| 47 del "%~dp0git.zip" | |
| 48 :: Create the batch files and win32pad. | |
| 49 call copy /y "%~dp0git.bat" "%WIN_TOOLS_ROOT_DIR%\git.bat" 1>nul | |
| 50 call copy /y "%~dp0ssh.bat" "%WIN_TOOLS_ROOT_DIR%\ssh.bat" 1>nul | |
| 51 call copy /y "%~dp0win32pad.exe" "%WIN_TOOLS_ROOT_DIR%\win32pad.exe" 1>nul | |
| 52 call copy /y "%~dp0README.win32pad" "%WIN_TOOLS_ROOT_DIR%\README.win32pad" 1>nul | |
| 53 goto :SVN_CHECK | |
| 54 | |
| 55 | |
| 56 :GIT_FAIL | |
| 57 echo ... Failed to checkout git automatically. | |
| 58 echo Please visit http://code.google.com/p/msysgit to download the latest git | |
| 59 echo client before continuing. | |
| 60 echo You can also get the "prebacked" version used at %WIN_TOOLS_ROOT_URL%/ | |
| 61 set ERRORLEVEL=1 | |
| 62 goto :END | |
| 63 | |
| 64 | |
| 24 :SVN_CHECK | 65 :SVN_CHECK |
| 25 :: If the batch file exists, skip the svn check. | 66 :: If the batch file exists, skip the svn check. |
| 26 if exist "%WIN_TOOLS_ROOT_DIR%\svn.bat" goto :PYTHON_CHECK | 67 if exist "%WIN_TOOLS_ROOT_DIR%\svn.bat" goto :PYTHON_CHECK |
| 27 if "%WIN_TOOLS_FORCE%" == "1" goto :SVN_INSTALL | 68 if "%WIN_TOOLS_FORCE%" == "1" goto :SVN_INSTALL |
| 28 call svn --version 2>nul 1>nul | 69 call svn --version 2>nul 1>nul |
| 29 if errorlevel 1 goto :SVN_INSTALL | 70 if errorlevel 1 goto :SVN_INSTALL |
| 30 goto :PYTHON_CHECK | 71 goto :PYTHON_CHECK |
| 31 | 72 |
| 32 | 73 |
| 33 :SVN_INSTALL | 74 :SVN_INSTALL |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 93 goto :END | 134 goto :END |
| 94 | 135 |
| 95 | 136 |
| 96 :returncode | 137 :returncode |
| 97 set WIN_TOOLS_ROOT_URL= | 138 set WIN_TOOLS_ROOT_URL= |
| 98 set WIN_TOOLS_ROOT_DIR= | 139 set WIN_TOOLS_ROOT_DIR= |
| 99 exit /b %ERRORLEVEL% | 140 exit /b %ERRORLEVEL% |
| 100 | 141 |
| 101 :END | 142 :END |
| 102 call :returncode %ERRORLEVEL% | 143 call :returncode %ERRORLEVEL% |
| OLD | NEW |