Commit 44b73307 authored by Samuel Attard's avatar Samuel Attard Committed by LUCI CQ

ensure depot_tools and cipd can bootstrap on all windows paths

On windows paths with spaces some cipd and depot_tools bootstrap commands were failing due to misquoting or syntax that didn't support such paths.  This ensures that a clean bootstrap on a path such as "C:/Foo Bar/depot_tools" works as expected.

Change-Id: Ib516d16ed7809635369399f3df0eff2269ff6e2b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3834965Reviewed-by: 's avatarJosip Sokcevic <sokcevic@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
parent 1cf1fb5d
......@@ -33,7 +33,7 @@ if not exist "%BOOTSTRAP_ROOT_DIR%\.bleeding_edge" (
:: This method requires EnableDelayedExpansion, and extracts the Python version
:: from our CIPD manifest. Variables referenced using "!" instead of "%" are
:: delayed expansion variables.
for /F "tokens=*" %%A in (%~dp0%CIPD_MANIFEST%) do (
for /F "usebackq tokens=*" %%A in ("%~dp0%CIPD_MANIFEST%") do (
set LINE=%%A
if not "x!LINE:cpython/=!" == "x!LINE!" set PYTHON_VERSION=!LINE:*version:=!
if not "x!LINE:cpython3/=!" == "x!LINE!" set PYTHON3_VERSION=!LINE:*version:=!
......
......@@ -6,10 +6,10 @@
setlocal
set CIPD_BACKEND=https://chrome-infra-packages.appspot.com
set VERSION_FILE="%~dp0cipd_client_version"
set CIPD_BINARY="%~dp0.cipd_client.exe"
set VERSION_FILE=%~dp0cipd_client_version
set CIPD_BINARY=%~dp0.cipd_client.exe
if not exist %CIPD_BINARY% (
if not exist "%CIPD_BINARY%" (
call :CLEAN_BOOTSTRAP
goto :EXEC_CIPD
)
......@@ -46,9 +46,9 @@ exit /b %EXPORT_ERRORLEVEL%
:: and unzipping the depot_tools.zip distribution, we clear the Zone.Identifier
:: alternate data stream. This is equivalent to clicking the "Unblock" button
:: in the file's properties dialog.
echo.>%~dp0.cipd_impl.ps1:Zone.Identifier
echo.>"%~dp0.cipd_impl.ps1:Zone.Identifier"
powershell -NoProfile -ExecutionPolicy RemoteSigned ^
-Command "%~dp0.cipd_impl.ps1" ^
-File "%~dp0.cipd_impl.ps1" ^
-CipdBinary "%CIPD_BINARY%" ^
-BackendURL "%CIPD_BACKEND%" ^
-VersionFile "%VERSION_FILE%" ^
......
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