Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Side by Side Diff: bootstrap/win/win_tools.bat

Issue 26901003: Redo the python check to look for the directories too. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.
11 11
12 set WIN_TOOLS_ROOT_URL=http://src.chromium.org/svn/trunk/tools 12 set WIN_TOOLS_ROOT_URL=https://src.chromium.org/svn/trunk/tools
13 set GIT_BIN_DIR=git-1.8.0_bin 13 set GIT_BIN_DIR=git-1.8.0_bin
14 14
15 :: Get absolute root directory (.js scripts don't handle relative paths well). 15 :: Get absolute root directory (.js scripts don't handle relative paths well).
16 pushd %~dp0..\.. 16 pushd %~dp0..\..
17 set WIN_TOOLS_ROOT_DIR=%CD% 17 set WIN_TOOLS_ROOT_DIR=%CD%
18 popd 18 popd
19 19
20 if "%1" == "force" ( 20 if "%1" == "force" (
21 set WIN_TOOLS_FORCE=1 21 set WIN_TOOLS_FORCE=1
22 shift /1 22 shift /1
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 :SVN_FAIL 106 :SVN_FAIL
107 echo ... Failed to checkout svn automatically. 107 echo ... Failed to checkout svn automatically.
108 echo Please visit http://subversion.tigris.org to download the latest subversion client 108 echo Please visit http://subversion.tigris.org to download the latest subversion client
109 echo before continuing. 109 echo before continuing.
110 echo You can also get the "prebacked" version used at %WIN_TOOLS_ROOT_URL%/third _party/ 110 echo You can also get the "prebacked" version used at %WIN_TOOLS_ROOT_URL%/third _party/
111 set ERRORLEVEL=1 111 set ERRORLEVEL=1
112 goto :END 112 goto :END
113 113
114 114
115 :PYTHON_CHECK 115 :PYTHON_CHECK
116 :: If the batch file exists, skip the python check. 116 if "%DEPOT_TOOLS_PYTHON_275%" == "1" goto :PY275_CHECK
117 set ERRORLEVEL=0 117 goto :PY26_CHECK
118 if exist "%WIN_TOOLS_ROOT_DIR%\python.bat" goto :END
119 if "%WIN_TOOLS_FORCE%" == "1" goto :PYTHON_INSTALL
120 call python --version 2>nul 1>nul
121 if errorlevel 1 goto :PYTHON_INSTALL
122 118
123 :: We are done. 119
120 :PY26_CHECK
121 if not exist "%WIN_TOOLS_ROOT_DIR%\python_bin" goto :PY26_INSTALL
122 if not exist "%WIN_TOOLS_ROOT_DIR%\python.bat" goto :PY26_INSTALL
124 set ERRORLEVEL=0 123 set ERRORLEVEL=0
125 goto :END 124 goto :END
126 125
127 126
128 :PYTHON_INSTALL 127 :PY275_CHECK
129 if "%DEPOT_TOOLS_PYTHON_275%" == "1" goto :PY275_INSTALL 128 if not exist "%WIN_TOOLS_ROOT_DIR%\python275_bin" goto :PY275_INSTALL
130 goto :PY26_INSTALL 129 if not exist "%WIN_TOOLS_ROOT_DIR%\python.bat" goto :PY275_INSTALL
130 set ERRORLEVEL=0
131 goto :END
131 132
132 133
133 :PY275_INSTALL 134 :PY275_INSTALL
134 echo Installing python 2.7.5... 135 echo Installing python 2.7.5...
135 :: Cleanup python directory if it was existing. 136 :: 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 "%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 if exist "%~dp0python275.zip" del "%~dp0python275.zip"
138 echo Fetching from %WIN_TOOLS_ROOT_URL%/third_party/python275_bin.zip 139 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 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 if errorlevel 1 goto :PYTHON_FAIL
(...skipping 28 matching lines...) Expand all
169 goto :END 170 goto :END
170 171
171 172
172 :returncode 173 :returncode
173 set WIN_TOOLS_ROOT_URL= 174 set WIN_TOOLS_ROOT_URL=
174 set WIN_TOOLS_ROOT_DIR= 175 set WIN_TOOLS_ROOT_DIR=
175 exit /b %ERRORLEVEL% 176 exit /b %ERRORLEVEL%
176 177
177 :END 178 :END
178 call :returncode %ERRORLEVEL% 179 call :returncode %ERRORLEVEL%
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698