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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 | 101 |
102 if "%WIN_TOOLS_FORCE%" == "1" goto :GIT_INSTALL | 102 if "%WIN_TOOLS_FORCE%" == "1" goto :GIT_INSTALL |
103 | 103 |
104 if exist "%GIT_EXE_PATH%" ( | 104 if exist "%GIT_EXE_PATH%" ( |
105 call "%GIT_EXE_PATH%" --version 2>nul 1>nul | 105 call "%GIT_EXE_PATH%" --version 2>nul 1>nul |
106 if errorlevel 1 goto :GIT_INSTALL | 106 if errorlevel 1 goto :GIT_INSTALL |
107 rem Several git versions can live side-by-side; check the top-level | 107 rem Several git versions can live side-by-side; check the top-level |
108 rem batch script to make sure it points to the desired version. | 108 rem batch script to make sure it points to the desired version. |
109 find "%GIT_BIN_DIR%" "%WIN_TOOLS_ROOT_DIR%\git.bat" 2>nul 1>nul | 109 find "%GIT_BIN_DIR%" "%WIN_TOOLS_ROOT_DIR%\git.bat" 2>nul 1>nul |
110 if errorlevel 1 goto :GIT_MAKE_BATCH_FILES | 110 if errorlevel 1 goto :GIT_MAKE_BATCH_FILES |
111 goto :SVN_CHECK | 111 goto :SYNC_GIT_HELP_FILES |
112 ) | 112 ) |
113 goto :GIT_INSTALL | 113 goto :GIT_INSTALL |
114 | 114 |
115 :GIT_INSTALL | 115 :GIT_INSTALL |
116 echo Installing git %GIT_VERSION% (avg 1-2 min download) ... | 116 echo Installing git %GIT_VERSION% (avg 1-2 min download) ... |
117 echo Detected: %OS_BITS% bits | 117 echo Detected: %OS_BITS% bits |
118 if defined XP_SUFFIX echo ... Windows XP | 118 if defined XP_SUFFIX echo ... Windows XP |
119 if defined GIT_PORTABLE_FLOW echo ... Portable installation flow | 119 if defined GIT_PORTABLE_FLOW echo ... Portable installation flow |
120 | 120 |
121 :: git is not accessible; check it out and create 'proxy' files. | 121 :: git is not accessible; check it out and create 'proxy' files. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\gitk.bat" "%WIN_TOOLS_ROOT_DI
R%\gitk.bat" 1>nul | 157 call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\gitk.bat" "%WIN_TOOLS_ROOT_DI
R%\gitk.bat" 1>nul |
158 call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\ssh.bat" "%WIN_TOOLS_ROOT_DIR
%\ssh.bat" 1>nul | 158 call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\ssh.bat" "%WIN_TOOLS_ROOT_DIR
%\ssh.bat" 1>nul |
159 call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\ssh-keygen.bat" "%WIN_TOOLS_R
OOT_DIR%\ssh-keygen.bat" 1>nul | 159 call copy /y "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%\ssh-keygen.bat" "%WIN_TOOLS_R
OOT_DIR%\ssh-keygen.bat" 1>nul |
160 ) | 160 ) |
161 | 161 |
162 :: Ensure autocrlf and filemode are set correctly. | 162 :: Ensure autocrlf and filemode are set correctly. |
163 call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --system core.autocrlf false | 163 call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --system core.autocrlf false |
164 call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --system core.filemode false | 164 call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --system core.filemode false |
165 call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --system core.preloadindex true | 165 call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --system core.preloadindex true |
166 call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --system core.fscache true | 166 call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --system core.fscache true |
| 167 |
| 168 :SYNC_GIT_HELP_FILES |
| 169 :: Copy all the depot_tools docs into the mingw64 git docs root. |
| 170 :: /i : Make sure xcopy knows that the destination names a folder, not a file |
| 171 :: /q : Make xcopy quiet (though it still prints a `X File(s) copied` message |
| 172 :: which is why we have the > NUL) |
| 173 :: /d : Copy source files that are newer than the corresponding destination |
| 174 :: files only. This prevents excessive copying when none of the docs |
| 175 :: actually changed. |
| 176 :: /y : Don't prompt for overwrites (yes) |
| 177 if defined GIT_PORTABLE_FLOW ( |
| 178 xcopy /i /q /d /y "%WIN_TOOLS_ROOT_DIR%\man\html\*" "%GIT_INST_DIR%\mingw64\sh
are\doc\git-doc" > NUL |
| 179 ) |
167 goto :SVN_CHECK | 180 goto :SVN_CHECK |
168 | 181 |
169 | |
170 :GIT_FAIL | 182 :GIT_FAIL |
171 echo ... Failed to checkout git automatically. | 183 echo ... Failed to checkout git automatically. |
172 echo You should get the "prebaked" version used at %GIT_FETCH_URL% | 184 echo You should get the "prebaked" version used at %GIT_FETCH_URL% |
173 set ERRORLEVEL=1 | 185 set ERRORLEVEL=1 |
174 goto :END | 186 goto :END |
175 | 187 |
176 | 188 |
177 :SVN_CHECK | 189 :SVN_CHECK |
178 :: If the batch file exists, skip the svn check. | 190 :: If the batch file exists, skip the svn check. |
179 if exist "%WIN_TOOLS_ROOT_DIR%\svn.bat" goto :END | 191 if exist "%WIN_TOOLS_ROOT_DIR%\svn.bat" goto :END |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 goto :END | 223 goto :END |
212 | 224 |
213 | 225 |
214 :returncode | 226 :returncode |
215 set WIN_TOOLS_ROOT_URL= | 227 set WIN_TOOLS_ROOT_URL= |
216 set WIN_TOOLS_ROOT_DIR= | 228 set WIN_TOOLS_ROOT_DIR= |
217 exit /b %ERRORLEVEL% | 229 exit /b %ERRORLEVEL% |
218 | 230 |
219 :END | 231 :END |
220 call :returncode %ERRORLEVEL% | 232 call :returncode %ERRORLEVEL% |
OLD | NEW |