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 determine if python, git, or svn binaries need updates. It | 6 :: This script will determine if python, git, or svn binaries need updates. It |
7 :: returns 123 if the user's shell must restart, otherwise !0 is failure | 7 :: returns 123 if the user's shell must restart, otherwise !0 is failure |
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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 93 |
94 call "%GIT_EXE_PATH%" --version 2>nul 1>nul | 94 call "%GIT_EXE_PATH%" --version 2>nul 1>nul |
95 if errorlevel 1 goto :GIT_INSTALL | 95 if errorlevel 1 goto :GIT_INSTALL |
96 | 96 |
97 :: Several git versions can live side-by-side; check the top-level | 97 :: Several git versions can live side-by-side; check the top-level |
98 :: batch script to make sure it points to the desired version. | 98 :: batch script to make sure it points to the desired version. |
99 for %%f in (git.bat gitk.bat ssh.bat ssh-keygen.bat git-bash) do ( | 99 for %%f in (git.bat gitk.bat ssh.bat ssh-keygen.bat git-bash) do ( |
100 %FIND_EXE% "%GIT_BIN_DIR%" "%WIN_TOOLS_ROOT_DIR%\%%f" 2>nul 1>nul | 100 %FIND_EXE% "%GIT_BIN_DIR%" "%WIN_TOOLS_ROOT_DIR%\%%f" 2>nul 1>nul |
101 if errorlevel 1 goto :GIT_MAKE_BATCH_FILES | 101 if errorlevel 1 goto :GIT_MAKE_BATCH_FILES |
102 ) | 102 ) |
| 103 if not exist %GIT_INST_DIR%\etc\profile.d\python.sh goto :GIT_MAKE_BATCH_FILES |
103 goto :SYNC_GIT_HELP_FILES | 104 goto :SYNC_GIT_HELP_FILES |
104 | 105 |
105 :GIT_INSTALL | 106 :GIT_INSTALL |
106 echo Installing git %GIT_VERSION% (avg 1-2 min download) ... | 107 echo Installing git %GIT_VERSION% (avg 1-2 min download) ... |
107 | 108 |
108 if exist "%GIT_DOWNLOAD_PATH%" del "%GIT_DOWNLOAD_PATH%" | 109 if exist "%GIT_DOWNLOAD_PATH%" del "%GIT_DOWNLOAD_PATH%" |
109 echo Fetching from %GIT_FETCH_URL% | 110 echo Fetching from %GIT_FETCH_URL% |
110 cscript //nologo //e:jscript "%~dp0get_file.js" %GIT_FETCH_URL% "%GIT_DOWNLOAD_P
ATH%" | 111 cscript //nologo //e:jscript "%~dp0get_file.js" %GIT_FETCH_URL% "%GIT_DOWNLOAD_P
ATH%" |
111 if errorlevel 1 goto :GIT_FAIL | 112 if errorlevel 1 goto :GIT_FAIL |
112 :: Cleanup git directory if it already exists. | 113 :: Cleanup git directory if it already exists. |
(...skipping 18 matching lines...) Expand all Loading... |
131 | 132 |
132 :GIT_MAKE_BATCH_FILES | 133 :GIT_MAKE_BATCH_FILES |
133 :: Create the batch files. | 134 :: Create the batch files. |
134 set GIT_TEMPL=%~dp0git.template.bat | 135 set GIT_TEMPL=%~dp0git.template.bat |
135 set SED=%GIT_INST_DIR%\usr\bin\sed.exe | 136 set SED=%GIT_INST_DIR%\usr\bin\sed.exe |
136 call "%SED%" -e "s/GIT_BIN_DIR/%GIT_BIN_DIR%/g" -e "s/GIT_PROGRAM/cmd\\\\git.exe
/g" < %GIT_TEMPL% > "%WIN_TOOLS_ROOT_DIR%\git.bat" | 137 call "%SED%" -e "s/GIT_BIN_DIR/%GIT_BIN_DIR%/g" -e "s/GIT_PROGRAM/cmd\\\\git.exe
/g" < %GIT_TEMPL% > "%WIN_TOOLS_ROOT_DIR%\git.bat" |
137 call "%SED%" -e "s/GIT_BIN_DIR/%GIT_BIN_DIR%/g" -e "s/GIT_PROGRAM/cmd\\\\gitk.ex
e/g" < %GIT_TEMPL% > "%WIN_TOOLS_ROOT_DIR%\gitk.bat" | 138 call "%SED%" -e "s/GIT_BIN_DIR/%GIT_BIN_DIR%/g" -e "s/GIT_PROGRAM/cmd\\\\gitk.ex
e/g" < %GIT_TEMPL% > "%WIN_TOOLS_ROOT_DIR%\gitk.bat" |
138 call "%SED%" -e "s/GIT_BIN_DIR/%GIT_BIN_DIR%/g" -e "s/GIT_PROGRAM/usr\\\\bin\\\\
ssh.exe/g" < %GIT_TEMPL% > "%WIN_TOOLS_ROOT_DIR%\ssh.bat" | 139 call "%SED%" -e "s/GIT_BIN_DIR/%GIT_BIN_DIR%/g" -e "s/GIT_PROGRAM/usr\\\\bin\\\\
ssh.exe/g" < %GIT_TEMPL% > "%WIN_TOOLS_ROOT_DIR%\ssh.bat" |
139 call "%SED%" -e "s/GIT_BIN_DIR/%GIT_BIN_DIR%/g" -e "s/GIT_PROGRAM/usr\\\\bin\\\\
ssh-keygen.exe/g" < %GIT_TEMPL% > "%WIN_TOOLS_ROOT_DIR%\ssh-keygen.bat" | 140 call "%SED%" -e "s/GIT_BIN_DIR/%GIT_BIN_DIR%/g" -e "s/GIT_PROGRAM/usr\\\\bin\\\\
ssh-keygen.exe/g" < %GIT_TEMPL% > "%WIN_TOOLS_ROOT_DIR%\ssh-keygen.bat" |
140 call "%SED%" -e "s/GIT_BIN_DIR/%GIT_BIN_DIR%/g" -e "s/PYTHON_BIN_DIR/python276_b
in/g" -e "s/SVN_BIN_DIR/svn_bin/g" < %~dp0git-bash.template.sh > "%WIN_TOOLS_ROO
T_DIR%\git-bash" | 141 call "%SED%" -e "s/GIT_BIN_DIR/%GIT_BIN_DIR%/g" -e "s/PYTHON_BIN_DIR/python276_b
in/g" -e "s/SVN_BIN_DIR/svn_bin/g" < %~dp0git-bash.template.sh > "%WIN_TOOLS_ROO
T_DIR%\git-bash" |
| 142 copy "%~dp0profile.d.python.sh" %GIT_INST_DIR%\etc\profile.d\python.sh > NUL |
141 | 143 |
142 :: Ensure various git configurations are set correctly at they system level. | 144 :: Ensure various git configurations are set correctly at they system level. |
143 call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --system core.autocrlf false | 145 call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --system core.autocrlf false |
144 call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --system core.filemode false | 146 call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --system core.filemode false |
145 call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --system core.preloadindex true | 147 call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --system core.preloadindex true |
146 call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --system core.fscache true | 148 call "%WIN_TOOLS_ROOT_DIR%\git.bat" config --system core.fscache true |
147 | 149 |
148 :SYNC_GIT_HELP_FILES | 150 :SYNC_GIT_HELP_FILES |
149 :: Copy all the depot_tools docs into the mingw64 git docs root. | 151 :: Copy all the depot_tools docs into the mingw64 git docs root. |
150 :: /i : Make sure xcopy knows that the destination names a folder, not a file | 152 :: /i : Make sure xcopy knows that the destination names a folder, not a file |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 goto :END | 215 goto :END |
214 | 216 |
215 | 217 |
216 :returncode | 218 :returncode |
217 set WIN_TOOLS_ROOT_URL= | 219 set WIN_TOOLS_ROOT_URL= |
218 set WIN_TOOLS_ROOT_DIR= | 220 set WIN_TOOLS_ROOT_DIR= |
219 exit /b %ERRORLEVEL% | 221 exit /b %ERRORLEVEL% |
220 | 222 |
221 :END | 223 :END |
222 call :returncode %ERRORLEVEL% | 224 call :returncode %ERRORLEVEL% |
OLD | NEW |