Skip to content

Commit b15b6b7

Browse files
committed
Update configure to work with space in installation path
Signed-off-by: Chin Yeung Li <[email protected]>
1 parent 4004ebe commit b15b6b7

File tree

1 file changed

+23
-15
lines changed

1 file changed

+23
-15
lines changed

configure.bat

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ set "CFG_BIN_DIR=%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\Scripts"
4949

5050
@rem ################################
5151
@rem # Thirdparty package locations and index handling
52-
if exist ""%CFG_ROOT_DIR%\thirdparty"" (
53-
set "PIP_EXTRA_ARGS=--find-links %CFG_ROOT_DIR%\thirdparty "
52+
if exist "%CFG_ROOT_DIR%\thirdparty" (
53+
set PIP_EXTRA_ARGS=--find-links "%CFG_ROOT_DIR%\thirdparty"
5454
)
5555

56-
set "PIP_EXTRA_ARGS=%PIP_EXTRA_ARGS% --find-links https://thirdparty.aboutcode.org/pypi" & %INDEX_ARG%
56+
set "PIP_EXTRA_ARGS=%PIP_EXTRA_ARGS%" --find-links https://thirdparty.aboutcode.org/pypi & %INDEX_ARG%
5757
@rem ################################
5858

5959

@@ -67,15 +67,15 @@ if not defined CFG_QUIET (
6767
@rem ################################
6868
@rem # Main command line entry point
6969
set CFG_DEV_MODE=0
70-
set "CFG_REQUIREMENTS=%REQUIREMENTS%"
70+
set CFG_REQUIREMENTS=%REQUIREMENTS%
7171
set "NO_INDEX=--no-index"
7272

7373
:again
7474
if not "%1" == "" (
7575
if "%1" EQU "--help" (goto cli_help)
7676
if "%1" EQU "--clean" (goto clean)
7777
if "%1" EQU "--dev" (
78-
set "CFG_REQUIREMENTS=%DEV_REQUIREMENTS%"
78+
set CFG_REQUIREMENTS=%DEV_REQUIREMENTS%
7979
set CFG_DEV_MODE=1
8080
)
8181
if "%1" EQU "--init" (
@@ -94,8 +94,8 @@ set "PIP_EXTRA_ARGS=%PIP_EXTRA_ARGS% %NO_INDEX%"
9494
@rem # Otherwise the latest Python by default.
9595
if not defined PYTHON_EXECUTABLE (
9696
@rem # check for a file named PYTHON_EXECUTABLE
97-
if exist ""%CFG_ROOT_DIR%\PYTHON_EXECUTABLE"" (
98-
set /p PYTHON_EXECUTABLE=<""%CFG_ROOT_DIR%\PYTHON_EXECUTABLE""
97+
if exist "%CFG_ROOT_DIR%\PYTHON_EXECUTABLE" (
98+
set /p PYTHON_EXECUTABLE=<"%CFG_ROOT_DIR%\PYTHON_EXECUTABLE"
9999
) else (
100100
set "PYTHON_EXECUTABLE=py"
101101
)
@@ -107,22 +107,22 @@ if not defined PYTHON_EXECUTABLE (
107107
@rem # presence is not consistent across Linux distro and sometimes pip is not
108108
@rem # included either by default. The virtualenv.pyz app cures all these issues.
109109

110-
if not exist ""%CFG_BIN_DIR%\python.exe"" (
110+
if not exist "%CFG_BIN_DIR%\python.exe" (
111111
if not exist "%CFG_BIN_DIR%" (
112-
mkdir %CFG_BIN_DIR%
112+
mkdir "%CFG_BIN_DIR%"
113113
)
114114

115-
if exist ""%CFG_ROOT_DIR%\etc\thirdparty\virtualenv.pyz"" (
115+
if exist "%CFG_ROOT_DIR%\etc\thirdparty\virtualenv.pyz" (
116116
%PYTHON_EXECUTABLE% "%CFG_ROOT_DIR%\etc\thirdparty\virtualenv.pyz" ^
117117
--wheel embed --pip embed --setuptools embed ^
118118
--seeder pip ^
119119
--never-download ^
120120
--no-periodic-update ^
121121
--no-vcs-ignore ^
122122
%CFG_QUIET% ^
123-
%CFG_ROOT_DIR%\%VIRTUALENV_DIR%
123+
"%CFG_ROOT_DIR%\%VIRTUALENV_DIR%"
124124
) else (
125-
if not exist ""%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\virtualenv.pyz"" (
125+
if not exist "%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\virtualenv.pyz" (
126126
curl -o "%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\virtualenv.pyz" %VIRTUALENV_PYZ_URL%
127127

128128
if %ERRORLEVEL% neq 0 (
@@ -136,7 +136,7 @@ if not exist ""%CFG_BIN_DIR%\python.exe"" (
136136
--no-periodic-update ^
137137
--no-vcs-ignore ^
138138
%CFG_QUIET% ^
139-
%CFG_ROOT_DIR%\%VIRTUALENV_DIR%
139+
"%CFG_ROOT_DIR%\%VIRTUALENV_DIR%"
140140
)
141141
)
142142

@@ -152,7 +152,15 @@ if %ERRORLEVEL% neq 0 (
152152
@rem # speeds up the installation.
153153
@rem # We always have the PEP517 build dependencies installed already.
154154

155-
%CFG_BIN_DIR%\pip install ^
155+
echo "%CFG_BIN_DIR%\pip" install ^
156+
--upgrade ^
157+
--no-build-isolation ^
158+
%CFG_QUIET% ^
159+
%PIP_EXTRA_ARGS% ^
160+
%CFG_REQUIREMENTS%
161+
162+
163+
"%CFG_BIN_DIR%\pip" install ^
156164
--upgrade ^
157165
--no-build-isolation ^
158166
%CFG_QUIET% ^
@@ -163,7 +171,7 @@ if %ERRORLEVEL% neq 0 (
163171
if exist "%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\bin" (
164172
rmdir /s /q "%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\bin"
165173
)
166-
mklink /J %CFG_ROOT_DIR%\%VIRTUALENV_DIR%\bin %CFG_ROOT_DIR%\%VIRTUALENV_DIR%\Scripts
174+
mklink /J "%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\bin" "%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\Scripts"
167175

168176
if %ERRORLEVEL% neq 0 (
169177
exit /b %ERRORLEVEL%

0 commit comments

Comments
 (0)