Commit ca4fdfd8 authored by maruel@chromium.org's avatar maruel@chromium.org

Add python 2.7.5 support on Windows. Not enabled by default.

- Python2.7.5 will be installed only if DEPOT_TOOLS_PYTHON_275=1,
  otherwise 2.6 is installed.
- Eventually the default will be changed to install python 2.7.5
  for new users.
- Afterward, python 2.7.5 will be always installed when not detected
  and 2.6 will be ignored.

README.chromium contains the exact instructions how to recreate
python275_bin.zip that was committed independently.

I tested it on a vanilla Windows XP image and documented how to
install the VC90 CRT redistributable in that specific case in
README.chromium.

R=iannucci@chromium.org
BUG=241769,257696

Review URL: https://codereview.chromium.org/26326002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@227961 0039d316-1c4b-4281-b951-d872f2087c98
parent c1c96356
@echo off
:: Copyright 2013 The Chromium Authors. All rights reserved.
:: Use of this source code is governed by a BSD-style license that can be
:: found in the LICENSE file.
setlocal
set PATH=%~dp0python275_bin;%~dp0python275_bin\Scripts;%PATH%
"%~dp0python275_bin\python.exe" %*
......@@ -43,6 +43,7 @@ rmdir /S /Q "%WIN_TOOLS_ROOT_DIR%\%GIT_BIN_DIR%"
echo Installing git (avg 1-2 min download) ...
:: git is not accessible; check it out and create 'proxy' files.
if exist "%~dp0git.zip" del "%~dp0git.zip"
echo Fetching from %WIN_TOOLS_ROOT_URL%/third_party/git-1.8.0_bin.zip
cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party/git-1.8.0_bin.zip "%~dp0git.zip"
if errorlevel 1 goto :GIT_FAIL
:: Cleanup svn directory if it was existing.
......@@ -85,6 +86,7 @@ goto :PYTHON_CHECK
echo Installing subversion ...
:: svn is not accessible; check it out and create 'proxy' files.
if exist "%~dp0svn.zip" del "%~dp0svn.zip"
echo Fetching from %WIN_TOOLS_ROOT_URL%/third_party/svn_bin.zip
cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party/svn_bin.zip "%~dp0svn.zip"
if errorlevel 1 goto :SVN_FAIL
:: Cleanup svn directory if it was existing.
......@@ -124,7 +126,29 @@ goto :END
:PYTHON_INSTALL
echo Installing python ...
if "%DEPOT_TOOLS_PYTHON_275%" == "1" goto :PY275_INSTALL
goto :PY26_INSTALL
:PY275_INSTALL
echo Installing python 2.7.5...
:: Cleanup python directory if it was existing.
if exist "%WIN_TOOLS_ROOT_DIR%\python275_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\python275_bin"
if exist "%~dp0python275.zip" del "%~dp0python275.zip"
echo Fetching from %WIN_TOOLS_ROOT_URL%/third_party/python275_bin.zip
cscript //nologo //e:jscript "%~dp0get_file.js" %WIN_TOOLS_ROOT_URL%/third_party/python275_bin.zip "%~dp0python275_bin.zip"
if errorlevel 1 goto :PYTHON_FAIL
:: Will create python275_bin\...
cscript //nologo //e:jscript "%~dp0unzip.js" "%~dp0python275_bin.zip" "%WIN_TOOLS_ROOT_DIR%"
:: Create the batch files.
call copy /y "%~dp0python275.new.bat" "%WIN_TOOLS_ROOT_DIR%\python.bat" 1>nul
call copy /y "%~dp0pylint.new.bat" "%WIN_TOOLS_ROOT_DIR%\pylint.bat" 1>nul
set ERRORLEVEL=0
goto :END
:PY26_INSTALL
echo Installing python 2.6...
:: Cleanup python directory if it was existing.
if exist "%WIN_TOOLS_ROOT_DIR%\python_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\python_bin"
call svn co -q %WIN_TOOLS_ROOT_URL%/third_party/python_26 "%WIN_TOOLS_ROOT_DIR%\python_bin"
......@@ -138,7 +162,7 @@ goto :END
:PYTHON_FAIL
echo ... Failed to checkout python automatically.
echo Please visit http://python.org to download the latest python 2.x client before
echo Please visit http://python.org to download the latest python 2.7.x client before
echo continuing.
echo You can also get the "prebacked" version used at %WIN_TOOLS_ROOT_URL%/third_party/
set ERRORLEVEL=1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment