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 batch file will try to sync the root directory. | 6 :: This batch file will try to sync the root directory. |
7 | 7 |
8 setlocal | 8 setlocal |
9 | 9 |
10 :: Windows freaks out if a file is overwritten while it's being executed. Copy | 10 :: Windows freaks out if a file is overwritten while it's being executed. Copy |
11 :: this script off to a temporary location and reinvoke from there before | 11 :: this script off to a temporary location and reinvoke from there before |
12 :: running any svn or git commands. | 12 :: running any svn or git commands. |
13 IF %~nx0==update_depot_tools.bat ( | 13 IF %~nx0==update_depot_tools.bat ( |
14 COPY /Y %~dp0update_depot_tools.bat %TEMP%\update_depot_tools_tmp.bat >nul | 14 COPY /Y %~dp0update_depot_tools.bat %TEMP%\update_depot_tools_tmp.bat >nul |
15 if errorlevel 1 goto :EOF | 15 if errorlevel 1 goto :EOF |
16 %TEMP%\update_depot_tools_tmp.bat %~dp0 %* | 16 %TEMP%\update_depot_tools_tmp.bat %~dp0 %* |
17 ) | 17 ) |
18 | 18 |
19 set DEPOT_TOOLS_DIR=%1 | 19 set DEPOT_TOOLS_DIR=%1 |
20 SHIFT | 20 SHIFT |
21 | 21 |
22 set GIT_URL=https://chromium.googlesource.com/chromium/tools/depot_tools.git | 22 set GIT_URL=https://chromium.googlesource.com/chromium/tools/depot_tools.git |
23 | 23 |
24 :: Will download git, svn and python. | 24 :: Will download git, svn and python. |
25 call "%DEPOT_TOOLS_DIR%bootstrap\win\win_tools.bat" | 25 call "%DEPOT_TOOLS_DIR%bootstrap\win\win_tools.bat" |
26 if errorlevel 1 goto :EOF | 26 if errorlevel 1 goto :EOF |
27 :: Now clear errorlevel so it can be set by other programs later. | 27 :: Now clear errorlevel so it can be set by other programs later. |
28 set errorlevel= | 28 set errorlevel= |
29 | 29 |
| 30 :: Initialize/update virtualenv. |
| 31 set VIRTUALENV_REPO=https://chromium.googlesource.com/infra/third_party/virtuale
nv.git |
| 32 set VIRTUALENV_REVISION=4243b272823228dde5d18a7400c404ce52fb4cea |
| 33 cd /d "%DEPOT_TOOLS_DIR%." |
| 34 IF NOT EXIST "bootstrap\virtualenv" ( |
| 35 echo Fetching virtualenv from %VIRTUALENV_REPO%@%VIRTUALENV_REVISION% |
| 36 call git clone %VIRTUALENV_REPO% "bootstrap\virtualenv" --no-checkout --quiet |
| 37 if errorlevel 1 goto :EOF |
| 38 cd "bootstrap\virtualenv\." |
| 39 call git checkout %VIRTUALENV_REVISION% --quiet |
| 40 if errorlevel 1 goto :EOF |
| 41 cd ..\.. |
| 42 echo Done fetching virtualenv |
| 43 ) |
| 44 python -u bootstrap\bootstrap.py --deps_file bootstrap\deps.pyl --quiet ENV |
| 45 if errorlevel 1 goto :EOF |
| 46 |
30 :: Shall skip automatic update? | 47 :: Shall skip automatic update? |
31 IF "%DEPOT_TOOLS_UPDATE%" == "0" GOTO :EOF | 48 IF "%DEPOT_TOOLS_UPDATE%" == "0" GOTO :EOF |
32 | 49 |
33 :: We need either .\.svn\. or .\.git\. to be able to sync. | 50 :: We need either .\.svn\. or .\.git\. to be able to sync. |
34 IF EXIST "%DEPOT_TOOLS_DIR%.svn\." GOTO :SVN_UPDATE | 51 IF EXIST "%DEPOT_TOOLS_DIR%.svn\." GOTO :SVN_UPDATE |
35 IF EXIST "%DEPOT_TOOLS_DIR%.git\." GOTO :GIT_UPDATE | 52 IF EXIST "%DEPOT_TOOLS_DIR%.git\." GOTO :GIT_UPDATE |
36 echo Error updating depot_tools, no revision tool found. | 53 echo Error updating depot_tools, no revision tool found. |
37 goto :EOF | 54 goto :EOF |
38 | 55 |
39 | 56 |
(...skipping 23 matching lines...) Expand all Loading... |
63 call git fetch -q origin > NUL | 80 call git fetch -q origin > NUL |
64 call git rebase -q origin/master > NUL | 81 call git rebase -q origin/master > NUL |
65 if errorlevel 1 echo Failed to update depot_tools. | 82 if errorlevel 1 echo Failed to update depot_tools. |
66 goto :EOF | 83 goto :EOF |
67 | 84 |
68 | 85 |
69 :GIT_SVN_UPDATE | 86 :GIT_SVN_UPDATE |
70 cd /d "%DEPOT_TOOLS_DIR%." | 87 cd /d "%DEPOT_TOOLS_DIR%." |
71 call git svn rebase -q -q | 88 call git svn rebase -q -q |
72 goto :EOF | 89 goto :EOF |
OLD | NEW |