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 25 matching lines...) Expand all Loading... | |
36 :MSYS_PATH_CHECK | 36 :MSYS_PATH_CHECK |
37 call find "mingw" "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\cmd\git.cmd" 2>nul 1>nul | 37 call find "mingw" "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\cmd\git.cmd" 2>nul 1>nul |
38 if errorlevel 1 goto :SVN_CHECK | 38 if errorlevel 1 goto :SVN_CHECK |
39 rmdir /S /Q "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%" | 39 rmdir /S /Q "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%" |
40 | 40 |
41 | 41 |
42 :GIT_INSTALL | 42 :GIT_INSTALL |
43 echo Installing git (avg 1-2 min download) ... | 43 echo Installing git (avg 1-2 min download) ... |
44 :: git is not accessible; check it out and create 'proxy' files. | 44 :: git is not accessible; check it out and create 'proxy' files. |
45 if exist "%~dp0git.zip" del "%~dp0git.zip" | 45 if exist "%~dp0git.zip" del "%~dp0git.zip" |
46 echo Fetching from %WIN_TOOLS_ROOT_URL%/third_party/git-1.8.0_bin.zip | |
46 cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party /git-1.8.0_bin.zip "%~dp0git.zip" | 47 cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party /git-1.8.0_bin.zip "%~dp0git.zip" |
47 if errorlevel 1 goto :GIT_FAIL | 48 if errorlevel 1 goto :GIT_FAIL |
48 :: Cleanup svn directory if it was existing. | 49 :: Cleanup svn directory if it was existing. |
49 if exist "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\% GIT_BIN_DIR%" | 50 if exist "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\% GIT_BIN_DIR%" |
50 :: Will create %GIT_BIN_DIR%\... | 51 :: Will create %GIT_BIN_DIR%\... |
51 cscript //nologo //e:jscript "%~dp0unzip.js" "%~dp0git.zip" "%WIN_TOOLS_ROOT_DIR %" | 52 cscript //nologo //e:jscript "%~dp0unzip.js" "%~dp0git.zip" "%WIN_TOOLS_ROOT_DIR %" |
52 if errorlevel 1 goto :GIT_FAIL | 53 if errorlevel 1 goto :GIT_FAIL |
53 if not exist "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\." goto :GIT_FAIL | 54 if not exist "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\." goto :GIT_FAIL |
54 del "%~dp0git.zip" | 55 del "%~dp0git.zip" |
55 :: Create the batch files. | 56 :: Create the batch files. |
(...skipping 22 matching lines...) Expand all Loading... | |
78 if "%WIN_TOOLS_FORCE%" == "1" goto :SVN_INSTALL | 79 if "%WIN_TOOLS_FORCE%" == "1" goto :SVN_INSTALL |
79 call svn --version 2>nul 1>nul | 80 call svn --version 2>nul 1>nul |
80 if errorlevel 1 goto :SVN_INSTALL | 81 if errorlevel 1 goto :SVN_INSTALL |
81 goto :PYTHON_CHECK | 82 goto :PYTHON_CHECK |
82 | 83 |
83 | 84 |
84 :SVN_INSTALL | 85 :SVN_INSTALL |
85 echo Installing subversion ... | 86 echo Installing subversion ... |
86 :: svn is not accessible; check it out and create 'proxy' files. | 87 :: svn is not accessible; check it out and create 'proxy' files. |
87 if exist "%~dp0svn.zip" del "%~dp0svn.zip" | 88 if exist "%~dp0svn.zip" del "%~dp0svn.zip" |
89 echo Fetching from %WIN_TOOLS_ROOT_URL%/third_party/svn_bin.zip | |
88 cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party /svn_bin.zip "%~dp0svn.zip" | 90 cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party /svn_bin.zip "%~dp0svn.zip" |
89 if errorlevel 1 goto :SVN_FAIL | 91 if errorlevel 1 goto :SVN_FAIL |
90 :: Cleanup svn directory if it was existing. | 92 :: Cleanup svn directory if it was existing. |
91 if exist "%WIN_TOOLS_ROOT_DIR%\svn\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\svn" | 93 if exist "%WIN_TOOLS_ROOT_DIR%\svn\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\svn" |
92 if exist "%WIN_TOOLS_ROOT_DIR%\svn_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\svn_bin " | 94 if exist "%WIN_TOOLS_ROOT_DIR%\svn_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\svn_bin " |
93 :: Will create svn_bin\... | 95 :: Will create svn_bin\... |
94 cscript //nologo //e:jscript "%~dp0unzip.js" "%~dp0svn.zip" "%WIN_TOOLS_ROOT_DIR %" | 96 cscript //nologo //e:jscript "%~dp0unzip.js" "%~dp0svn.zip" "%WIN_TOOLS_ROOT_DIR %" |
95 if errorlevel 1 goto :SVN_FAIL | 97 if errorlevel 1 goto :SVN_FAIL |
96 if not exist "%WIN_TOOLS_ROOT_DIR%\svn_bin\." goto :SVN_FAIL | 98 if not exist "%WIN_TOOLS_ROOT_DIR%\svn_bin\." goto :SVN_FAIL |
97 del "%~dp0svn.zip" | 99 del "%~dp0svn.zip" |
(...skipping 19 matching lines...) Expand all Loading... | |
117 if "%WIN_TOOLS_FORCE%" == "1" goto :PYTHON_INSTALL | 119 if "%WIN_TOOLS_FORCE%" == "1" goto :PYTHON_INSTALL |
118 call python --version 2>nul 1>nul | 120 call python --version 2>nul 1>nul |
119 if errorlevel 1 goto :PYTHON_INSTALL | 121 if errorlevel 1 goto :PYTHON_INSTALL |
120 | 122 |
121 :: We are done. | 123 :: We are done. |
122 set ERRORLEVEL=0 | 124 set ERRORLEVEL=0 |
123 goto :END | 125 goto :END |
124 | 126 |
125 | 127 |
126 :PYTHON_INSTALL | 128 :PYTHON_INSTALL |
127 echo Installing python ... | 129 if "%DEPOT_TOOLS_PYTHON_275%" == "1" goto :PY275_INSTALL |
130 goto :PY26_INSTALL | |
131 | |
132 | |
133 :PY275_INSTALL | |
134 echo Installing python 2.7.5... | |
135 :: Cleanup python directory if it was existing. | |
136 if exist "%WIN_TOOLS_ROOT_DIR%\python275_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\p ython275_bin" | |
137 if exist "%~dp0python275.zip" del "%~dp0python275.zip" | |
138 echo Fetching from %WIN_TOOLS_ROOT_URL%/third_party/python275_bin.zip | |
139 cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party /python275_bin.zip "%~dp0python275_bin.zip" | |
140 if errorlevel 1 goto :PYTHON_FAIL | |
141 :: Will create python275_bin\... | |
142 cscript //nologo //e:jscript "%~dp0unzip.js" "%~dp0python275_bin.zip" "%WIN_TOOL S_ROOT_DIR%" | |
iannucci
2013/10/07 23:50:59
Is there a way for us to replace all of our bat fi
M-A Ruel
2013/10/08 00:55:52
It'd be fine but not overly excited.
| |
143 :: Create the batch files. | |
144 call copy /y "%~dp0python275.new.bat" "%WIN_TOOLS_ROOT_DIR%\python.bat" 1>nul | |
145 call copy /y "%~dp0pylint.new.bat" "%WIN_TOOLS_ROOT_DIR%\pylint.bat" 1>nul | |
iannucci
2013/10/07 23:50:59
Maybe create these before the directory so if we t
M-A Ruel
2013/10/08 00:55:52
Right now the python.bat script is a way to inhibi
| |
146 set ERRORLEVEL=0 | |
147 goto :END | |
148 | |
149 | |
150 :PY26_INSTALL | |
151 echo Installing python 2.6... | |
128 :: Cleanup python directory if it was existing. | 152 :: Cleanup python directory if it was existing. |
129 if exist "%WIN_TOOLS_ROOT_DIR%\python_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\pyth on_bin" | 153 if exist "%WIN_TOOLS_ROOT_DIR%\python_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\pyth on_bin" |
130 call svn co -q %WIN_TOOLS_ROOT_URL%/third_party/python_26 "%WIN_TOOLS_ROOT_DIR%\ python_bin" | 154 call svn co -q %WIN_TOOLS_ROOT_URL%/third_party/python_26 "%WIN_TOOLS_ROOT_DIR%\ python_bin" |
131 if errorlevel 1 goto :PYTHON_FAIL | 155 if errorlevel 1 goto :PYTHON_FAIL |
132 :: Create the batch files. | 156 :: Create the batch files. |
133 call copy /y "%~dp0python.new.bat" "%WIN_TOOLS_ROOT_DIR%\python.bat" 1>nul | 157 call copy /y "%~dp0python.new.bat" "%WIN_TOOLS_ROOT_DIR%\python.bat" 1>nul |
134 call copy /y "%~dp0pylint.new.bat" "%WIN_TOOLS_ROOT_DIR%\pylint.bat" 1>nul | 158 call copy /y "%~dp0pylint.new.bat" "%WIN_TOOLS_ROOT_DIR%\pylint.bat" 1>nul |
135 set ERRORLEVEL=0 | 159 set ERRORLEVEL=0 |
136 goto :END | 160 goto :END |
137 | 161 |
138 | 162 |
139 :PYTHON_FAIL | 163 :PYTHON_FAIL |
140 echo ... Failed to checkout python automatically. | 164 echo ... Failed to checkout python automatically. |
141 echo Please visit http://python.org to download the latest python 2.x client bef ore | 165 echo Please visit http://python.org to download the latest python 2.7.x client b efore |
142 echo continuing. | 166 echo continuing. |
143 echo You can also get the "prebacked" version used at %WIN_TOOLS_ROOT_URL%/third _party/ | 167 echo You can also get the "prebacked" version used at %WIN_TOOLS_ROOT_URL%/third _party/ |
144 set ERRORLEVEL=1 | 168 set ERRORLEVEL=1 |
145 goto :END | 169 goto :END |
146 | 170 |
147 | 171 |
148 :returncode | 172 :returncode |
149 set WIN_TOOLS_ROOT_URL= | 173 set WIN_TOOLS_ROOT_URL= |
150 set WIN_TOOLS_ROOT_DIR= | 174 set WIN_TOOLS_ROOT_DIR= |
151 exit /b %ERRORLEVEL% | 175 exit /b %ERRORLEVEL% |
152 | 176 |
153 :END | 177 :END |
154 call :returncode %ERRORLEVEL% | 178 call :returncode %ERRORLEVEL% |
OLD | NEW |