From e8eed65fecddfcb14a80b8c10c31bbfd6b5a1fc4 Mon Sep 17 00:00:00 2001 From: Dan Jacques Date: Wed, 12 Jul 2017 10:08:04 -0700 Subject: [PATCH] Always copy "python.bat". This change should be safe, since batch files are not generally write-contended, and "gclient" is run atomically (other things depend on this). The mechanism to detect whether we're downgrading is broken by "bot_update". While future syncs should not encounter this issue, current syncs still have no way to resolve it, and are left with a broken "python.bat" setup. We remedy this by always installing "python.bat", even if it's already there. This is safe, since the intended state of HEAD is for this file to be present at all times. BUG=chromium:741650 TEST=None Change-Id: Ief28217bf89d201d830c46b31e0b4040c51cb322 Reviewed-on: https://chromium-review.googlesource.com/568588 Reviewed-by: Sergey Berezin --- bootstrap/win/win_tools.bat | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/bootstrap/win/win_tools.bat b/bootstrap/win/win_tools.bat index eb8dd1034..cc8ed4b72 100644 --- a/bootstrap/win/win_tools.bat +++ b/bootstrap/win/win_tools.bat @@ -26,19 +26,13 @@ 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" ( - call copy /y "%~dp0python276.new.bat" "%WIN_TOOLS_ROOT_DIR%\python.bat" 1>nul - del "%WIN_TOOLS_ROOT_DIR%\python_bin_reldir.txt" -) - if not exist "%WIN_TOOLS_ROOT_DIR%\python276_bin" goto :PY27_INSTALL if not exist "%WIN_TOOLS_ROOT_DIR%\python.bat" goto :PY27_INSTALL + +:: Support revert from https://chromium-review.googlesource.com/c/563036 +:: Temporary fix, always install "python.bat" (crbug.com/741650). +call copy /y "%~dp0python276.new.bat" "%WIN_TOOLS_ROOT_DIR%\python.bat" 1>nul + set ERRORLEVEL=0 goto :GIT_CHECK