OLD | NEW |
1 @echo off | 1 @echo off |
2 :: Copyright (c) 2009 The Chromium Authors. All rights reserved. | 2 :: Copyright (c) 2009 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. |
(...skipping 15 matching lines...) Expand all Loading... |
26 if exist "%WIN_TOOLS_ROOT_DIR%\svn.bat" goto :PYTHON_CHECK | 26 if exist "%WIN_TOOLS_ROOT_DIR%\svn.bat" goto :PYTHON_CHECK |
27 if "%WIN_TOOLS_FORCE%" == "1" goto :SVN_INSTALL | 27 if "%WIN_TOOLS_FORCE%" == "1" goto :SVN_INSTALL |
28 call svn --version 2>nul 1>nul | 28 call svn --version 2>nul 1>nul |
29 if errorlevel 1 goto :SVN_INSTALL | 29 if errorlevel 1 goto :SVN_INSTALL |
30 goto :PYTHON_CHECK | 30 goto :PYTHON_CHECK |
31 | 31 |
32 | 32 |
33 :SVN_INSTALL | 33 :SVN_INSTALL |
34 echo Installing subversion ... | 34 echo Installing subversion ... |
35 :: svn is not accessible; check it out and create 'proxy' files. | 35 :: svn is not accessible; check it out and create 'proxy' files. |
36 if exist "%~dp0svn.7z" del "%~dp0svn.7z" | 36 if exist "%~dp0svn.zip" del "%~dp0svn.zip" |
37 cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party
/svn_bin.zip "%~dp0svn.zip" | 37 cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party
/svn_bin.zip "%~dp0svn.zip" |
38 if errorlevel 1 goto :SVN_FAIL | 38 if errorlevel 1 goto :SVN_FAIL |
39 :: Cleanup svn directory if it was existing. | 39 :: Cleanup svn directory if it was existing. |
40 if exist "%WIN_TOOLS_ROOT_DIR%\svn\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\svn" | 40 if exist "%WIN_TOOLS_ROOT_DIR%\svn\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\svn" |
41 if exist "%WIN_TOOLS_ROOT_DIR%\svn_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\svn_bin
" | 41 if exist "%WIN_TOOLS_ROOT_DIR%\svn_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\svn_bin
" |
42 :: Will create svn_bin\... | 42 :: Will create svn_bin\... |
43 cscript //nologo //e:jscript "%~dp0unzip.js" "%~dp0svn.zip" "%WIN_TOOLS_ROOT_DIR
%" | 43 cscript //nologo //e:jscript "%~dp0unzip.js" "%~dp0svn.zip" "%WIN_TOOLS_ROOT_DIR
%" |
44 if errorlevel 1 goto :SVN_FAIL | 44 if errorlevel 1 goto :SVN_FAIL |
45 if not exist "%WIN_TOOLS_ROOT_DIR%\svn_bin\." goto :SVN_FAIL | 45 if not exist "%WIN_TOOLS_ROOT_DIR%\svn_bin\." goto :SVN_FAIL |
46 del "%~dp0svn.zip" | 46 del "%~dp0svn.zip" |
47 :: Create the batch file. | 47 :: Create the batch file. |
48 call copy /y "%~dp0svn.new.bat" "%WIN_TOOLS_ROOT_DIR%\svn.bat" 1>nul | 48 call copy /y "%~dp0svn.new.bat" "%WIN_TOOLS_ROOT_DIR%\svn.bat" 1>nul |
| 49 call copy /y "%~dp0svnversion.new.bat" "%WIN_TOOLS_ROOT_DIR%\svnversion.bat" 1>n
ul |
49 call copy /y "%~dp0svn.new" "%WIN_TOOLS_ROOT_DIR%\svn" 1>nul | 50 call copy /y "%~dp0svn.new" "%WIN_TOOLS_ROOT_DIR%\svn" 1>nul |
50 goto :PYTHON_CHECK | 51 goto :PYTHON_CHECK |
51 | 52 |
52 | 53 |
53 :SVN_FAIL | 54 :SVN_FAIL |
54 echo ... Failed to checkout svn automatically. | 55 echo ... Failed to checkout svn automatically. |
55 echo Please visit http://subversion.tigris.org to download the latest subversion
client | 56 echo Please visit http://subversion.tigris.org to download the latest subversion
client |
56 echo before continuing. | 57 echo before continuing. |
57 echo You can also get the "prebacked" version used at %WIN_TOOLS_ROOT_URL%/third
_party/ | 58 echo You can also get the "prebacked" version used at %WIN_TOOLS_ROOT_URL%/third
_party/ |
58 set ERRORLEVEL=1 | 59 set ERRORLEVEL=1 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 goto :END | 96 goto :END |
96 | 97 |
97 | 98 |
98 :returncode | 99 :returncode |
99 set WIN_TOOLS_ROOT_URL= | 100 set WIN_TOOLS_ROOT_URL= |
100 set WIN_TOOLS_ROOT_DIR= | 101 set WIN_TOOLS_ROOT_DIR= |
101 exit /b %ERRORLEVEL% | 102 exit /b %ERRORLEVEL% |
102 | 103 |
103 :END | 104 :END |
104 call :returncode %ERRORLEVEL% | 105 call :returncode %ERRORLEVEL% |
OLD | NEW |