Commit 4cb9d742 authored by Dan Jacques's avatar Dan Jacques Committed by Commit Bot

[bootstrap/win] Enable revert from upcoming patch.

The upcoming CL, https://chromium-review.googlesource.com/c/563036,
updates "bootstrap/win"'s mechanism. However, if that patch needs to be
reverted, its "python.bat" stub may still exist in the reverted
repository, and will continue to point to the reverted toolchain.

We don't have a good way to detect whether we should revert "python.bat".
Instead, we will look a file generated by the CL,
"//python_bin_reldir.txt". If we find it, we will assume that the updated
"python.bat" is in use, and reinstall.

Note that if that CL lands and does not require a revert, this logic
will be deleted. It's just there as a safety mechanism to allow a safe
revert.

BUG=chromium:740171
TEST=local

Change-Id: Ifc638cf0512d2a889c37fbf6b8e3f7a3269331b1
Reviewed-on: https://chromium-review.googlesource.com/566073
Commit-Queue: Daniel Jacques <dnj@chromium.org>
Reviewed-by: 's avatarRobbie Iannucci <iannucci@chromium.org>
parent 13e88538
......@@ -26,6 +26,18 @@ if "%1" == "force" (
:PYTHON_CHECK
:: Support revert from https://chromium-review.googlesource.com/c/563036
::
:: If the "python.bat" from that CL is installed, we will not know to
:: replace it if the CL is reverted. To support this, we will actively
:: destroy our "python.bat" if we detect a "python_bin_reldir.txt" file
:: present, causing us to reinstall Python.
if exist "%WIN_TOOLS_ROOT_DIR%\python_bin_reldir.txt" (
del "%WIN_TOOLS_ROOT_DIR%\python.bat"
del "%WIN_TOOLS_ROOT_DIR%\python_bin_reldir.txt"
goto :PY27_INSTALL
)
if not exist "%WIN_TOOLS_ROOT_DIR%\python276_bin" goto :PY27_INSTALL
if not exist "%WIN_TOOLS_ROOT_DIR%\python.bat" goto :PY27_INSTALL
set ERRORLEVEL=0
......
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