[bootstrap/win] Replace "python.bat" only on downgrade.

We're implementing a bootstrap downgrade for potential revert of
https://chromium-review.googlesource.com/c/563036

Currently, the downgrade sees the presence of the landed patch
as a sign to completely reinstall Python. However, this causes
the "python276_bin" directory to be deleted, which both ruins
any running process (notably "service manager" and BuildBot)
and fails due to those running processes, leaving the system in
a broken state.

Instead, we'll view the revert path as a signal to swap in the
old "python.bat" specifically, then fall through to standard
installation detection. Since the upgrade will not actually
delete "python276_bin", the expected revert case will leave it
alone, preserving existing execution environments.

BUG=chromium:740966, chromium:740171
TEST=local
  - Ran simulation of revert path with this change, observed
    better outcome.

Change-Id: I0dfa5924a27bcaba49134272a344f7b9f1d475c5
Reviewed-on: https://chromium-review.googlesource.com/567167
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Daniel Jacques <dnj@chromium.org>
changes/67/567167/2
Dan Jacques 8 years ago committed by Commit Bot
parent 24025d3e71
commit 265255f501

@ -33,9 +33,8 @@ if "%1" == "force" (
:: 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"
call copy /y "%~dp0python276.new.bat" "%WIN_TOOLS_ROOT_DIR%\python.bat" 1>nul
del "%WIN_TOOLS_ROOT_DIR%\python_bin_reldir.txt"
goto :PY27_INSTALL
)
if not exist "%WIN_TOOLS_ROOT_DIR%\python276_bin" goto :PY27_INSTALL

Loading…
Cancel
Save