| 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. |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 :SVN_FAIL | 109 :SVN_FAIL |
| 110 echo ... Failed to checkout svn automatically. | 110 echo ... Failed to checkout svn automatically. |
| 111 echo Please visit http://subversion.tigris.org to download the latest subversion
client | 111 echo Please visit http://subversion.tigris.org to download the latest subversion
client |
| 112 echo before continuing. | 112 echo before continuing. |
| 113 echo You can also get the "prebacked" version used at %WIN_TOOLS_ROOT_URL%/third
_party/ | 113 echo You can also get the "prebacked" version used at %WIN_TOOLS_ROOT_URL%/third
_party/ |
| 114 set ERRORLEVEL=1 | 114 set ERRORLEVEL=1 |
| 115 goto :END | 115 goto :END |
| 116 | 116 |
| 117 | 117 |
| 118 :PYTHON_CHECK | 118 :PYTHON_CHECK |
| 119 :: Note: while the variable talks about 2.7.5, we are now installing 2.7.6. |
| 120 :: Sorry for the confusion. :( |
| 119 if "%DEPOT_TOOLS_PYTHON_275%" == "0" goto :PY26_CHECK | 121 if "%DEPOT_TOOLS_PYTHON_275%" == "0" goto :PY26_CHECK |
| 120 goto :PY275_CHECK | 122 if "%DEPOT_TOOLS_PYTHON_27%" == "0" goto :PY26_CHECK |
| 123 goto :PY27_CHECK |
| 121 | 124 |
| 122 | 125 |
| 123 :PY26_CHECK | 126 :PY26_CHECK |
| 124 if not exist "%WIN_TOOLS_ROOT_DIR%\python_bin" goto :PY26_INSTALL | 127 if not exist "%WIN_TOOLS_ROOT_DIR%\python_bin" goto :PY26_INSTALL |
| 125 if not exist "%WIN_TOOLS_ROOT_DIR%\python.bat" goto :PY26_INSTALL | 128 if not exist "%WIN_TOOLS_ROOT_DIR%\python.bat" goto :PY26_INSTALL |
| 126 set ERRORLEVEL=0 | 129 set ERRORLEVEL=0 |
| 127 goto :END | 130 goto :END |
| 128 | 131 |
| 129 | 132 |
| 130 :PY275_CHECK | 133 :PY27_CHECK |
| 131 if not exist "%WIN_TOOLS_ROOT_DIR%\python275_bin" goto :PY275_INSTALL | 134 if not exist "%WIN_TOOLS_ROOT_DIR%\python276_bin" goto :PY27_INSTALL |
| 132 if not exist "%WIN_TOOLS_ROOT_DIR%\python.bat" goto :PY275_INSTALL | 135 if not exist "%WIN_TOOLS_ROOT_DIR%\python.bat" goto :PY27_INSTALL |
| 133 set ERRORLEVEL=0 | 136 set ERRORLEVEL=0 |
| 134 goto :END | 137 goto :END |
| 135 | 138 |
| 136 | 139 |
| 137 :PY275_INSTALL | 140 :PY27_INSTALL |
| 138 echo Installing python 2.7.5... | 141 echo Installing python 2.7.6... |
| 139 :: Cleanup python directory if it was existing. | 142 :: Cleanup python directory if it was existing. |
| 140 if exist "%WIN_TOOLS_ROOT_DIR%\python275_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\p
ython275_bin" | 143 if exist "%WIN_TOOLS_ROOT_DIR%\python276_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\p
ython276_bin" |
| 141 if exist "%ZIP_DIR%\python275.zip" del "%ZIP_DIR%\python275.zip" | 144 if exist "%ZIP_DIR%\python276.zip" del "%ZIP_DIR%\python276.zip" |
| 142 echo Fetching from %WIN_TOOLS_ROOT_URL%/third_party/python275_bin.zip | 145 echo Fetching from %WIN_TOOLS_ROOT_URL%/third_party/python276_bin.zip |
| 143 cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party
/python275_bin.zip "%ZIP_DIR%\python275_bin.zip" | 146 cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party
/python276_bin.zip "%ZIP_DIR%\python276_bin.zip" |
| 144 if errorlevel 1 goto :PYTHON_FAIL | 147 if errorlevel 1 goto :PYTHON_FAIL |
| 145 :: Will create python275_bin\... | 148 :: Will create python276_bin\... |
| 146 cscript //nologo //e:jscript "%~dp0unzip.js" "%ZIP_DIR%\python275_bin.zip" "%WIN
_TOOLS_ROOT_DIR%" | 149 cscript //nologo //e:jscript "%~dp0unzip.js" "%ZIP_DIR%\python276_bin.zip" "%WIN
_TOOLS_ROOT_DIR%" |
| 147 :: Create the batch files. | 150 :: Create the batch files. |
| 148 call copy /y "%~dp0python275.new.bat" "%WIN_TOOLS_ROOT_DIR%\python.bat" 1>nul | 151 call copy /y "%~dp0python276.new.bat" "%WIN_TOOLS_ROOT_DIR%\python.bat" 1>nul |
| 149 call copy /y "%~dp0pylint.new.bat" "%WIN_TOOLS_ROOT_DIR%\pylint.bat" 1>nul | 152 call copy /y "%~dp0pylint.new.bat" "%WIN_TOOLS_ROOT_DIR%\pylint.bat" 1>nul |
| 150 del "%ZIP_DIR%\python275_bin.zip" | 153 del "%ZIP_DIR%\python276_bin.zip" |
| 151 set ERRORLEVEL=0 | 154 set ERRORLEVEL=0 |
| 152 goto :END | 155 goto :END |
| 153 | 156 |
| 154 | 157 |
| 155 :PY26_INSTALL | 158 :PY26_INSTALL |
| 156 echo Installing python 2.6... | 159 echo Installing python 2.6... |
| 157 :: Cleanup python directory if it was existing. | 160 :: Cleanup python directory if it was existing. |
| 158 if exist "%WIN_TOOLS_ROOT_DIR%\python_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\pyth
on_bin" | 161 if exist "%WIN_TOOLS_ROOT_DIR%\python_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\pyth
on_bin" |
| 159 call svn co -q %WIN_TOOLS_ROOT_URL%/third_party/python_26 "%WIN_TOOLS_ROOT_DIR%\
python_bin" | 162 call svn co -q %WIN_TOOLS_ROOT_URL%/third_party/python_26 "%WIN_TOOLS_ROOT_DIR%\
python_bin" |
| 160 if errorlevel 1 goto :PYTHON_FAIL | 163 if errorlevel 1 goto :PYTHON_FAIL |
| (...skipping 13 matching lines...) Expand all Loading... |
| 174 goto :END | 177 goto :END |
| 175 | 178 |
| 176 | 179 |
| 177 :returncode | 180 :returncode |
| 178 set WIN_TOOLS_ROOT_URL= | 181 set WIN_TOOLS_ROOT_URL= |
| 179 set WIN_TOOLS_ROOT_DIR= | 182 set WIN_TOOLS_ROOT_DIR= |
| 180 exit /b %ERRORLEVEL% | 183 exit /b %ERRORLEVEL% |
| 181 | 184 |
| 182 :END | 185 :END |
| 183 call :returncode %ERRORLEVEL% | 186 call :returncode %ERRORLEVEL% |
| OLD | NEW |