From b15b6b79d965f452b14cc02578a45ba1c98138fe Mon Sep 17 00:00:00 2001 From: Chin Yeung Li Date: Thu, 17 Feb 2022 17:31:14 +0800 Subject: [PATCH 1/3] Update `configure` to work with space in installation path Signed-off-by: Chin Yeung Li --- configure.bat | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/configure.bat b/configure.bat index 4dfb201aa3..7e80e98947 100644 --- a/configure.bat +++ b/configure.bat @@ -49,11 +49,11 @@ set "CFG_BIN_DIR=%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\Scripts" @rem ################################ @rem # Thirdparty package locations and index handling -if exist ""%CFG_ROOT_DIR%\thirdparty"" ( - set "PIP_EXTRA_ARGS=--find-links %CFG_ROOT_DIR%\thirdparty " +if exist "%CFG_ROOT_DIR%\thirdparty" ( + set PIP_EXTRA_ARGS=--find-links "%CFG_ROOT_DIR%\thirdparty" ) -set "PIP_EXTRA_ARGS=%PIP_EXTRA_ARGS% --find-links https://thirdparty.aboutcode.org/pypi" & %INDEX_ARG% +set "PIP_EXTRA_ARGS=%PIP_EXTRA_ARGS%" --find-links https://thirdparty.aboutcode.org/pypi & %INDEX_ARG% @rem ################################ @@ -67,7 +67,7 @@ if not defined CFG_QUIET ( @rem ################################ @rem # Main command line entry point set CFG_DEV_MODE=0 -set "CFG_REQUIREMENTS=%REQUIREMENTS%" +set CFG_REQUIREMENTS=%REQUIREMENTS% set "NO_INDEX=--no-index" :again @@ -75,7 +75,7 @@ if not "%1" == "" ( if "%1" EQU "--help" (goto cli_help) if "%1" EQU "--clean" (goto clean) if "%1" EQU "--dev" ( - set "CFG_REQUIREMENTS=%DEV_REQUIREMENTS%" + set CFG_REQUIREMENTS=%DEV_REQUIREMENTS% set CFG_DEV_MODE=1 ) if "%1" EQU "--init" ( @@ -94,8 +94,8 @@ set "PIP_EXTRA_ARGS=%PIP_EXTRA_ARGS% %NO_INDEX%" @rem # Otherwise the latest Python by default. if not defined PYTHON_EXECUTABLE ( @rem # check for a file named PYTHON_EXECUTABLE - if exist ""%CFG_ROOT_DIR%\PYTHON_EXECUTABLE"" ( - set /p PYTHON_EXECUTABLE=<""%CFG_ROOT_DIR%\PYTHON_EXECUTABLE"" + if exist "%CFG_ROOT_DIR%\PYTHON_EXECUTABLE" ( + set /p PYTHON_EXECUTABLE=<"%CFG_ROOT_DIR%\PYTHON_EXECUTABLE" ) else ( set "PYTHON_EXECUTABLE=py" ) @@ -107,12 +107,12 @@ if not defined PYTHON_EXECUTABLE ( @rem # presence is not consistent across Linux distro and sometimes pip is not @rem # included either by default. The virtualenv.pyz app cures all these issues. -if not exist ""%CFG_BIN_DIR%\python.exe"" ( +if not exist "%CFG_BIN_DIR%\python.exe" ( if not exist "%CFG_BIN_DIR%" ( - mkdir %CFG_BIN_DIR% + mkdir "%CFG_BIN_DIR%" ) - if exist ""%CFG_ROOT_DIR%\etc\thirdparty\virtualenv.pyz"" ( + if exist "%CFG_ROOT_DIR%\etc\thirdparty\virtualenv.pyz" ( %PYTHON_EXECUTABLE% "%CFG_ROOT_DIR%\etc\thirdparty\virtualenv.pyz" ^ --wheel embed --pip embed --setuptools embed ^ --seeder pip ^ @@ -120,9 +120,9 @@ if not exist ""%CFG_BIN_DIR%\python.exe"" ( --no-periodic-update ^ --no-vcs-ignore ^ %CFG_QUIET% ^ - %CFG_ROOT_DIR%\%VIRTUALENV_DIR% + "%CFG_ROOT_DIR%\%VIRTUALENV_DIR%" ) else ( - if not exist ""%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\virtualenv.pyz"" ( + if not exist "%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\virtualenv.pyz" ( curl -o "%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\virtualenv.pyz" %VIRTUALENV_PYZ_URL% if %ERRORLEVEL% neq 0 ( @@ -136,7 +136,7 @@ if not exist ""%CFG_BIN_DIR%\python.exe"" ( --no-periodic-update ^ --no-vcs-ignore ^ %CFG_QUIET% ^ - %CFG_ROOT_DIR%\%VIRTUALENV_DIR% + "%CFG_ROOT_DIR%\%VIRTUALENV_DIR%" ) ) @@ -152,7 +152,15 @@ if %ERRORLEVEL% neq 0 ( @rem # speeds up the installation. @rem # We always have the PEP517 build dependencies installed already. -%CFG_BIN_DIR%\pip install ^ +echo "%CFG_BIN_DIR%\pip" install ^ + --upgrade ^ + --no-build-isolation ^ + %CFG_QUIET% ^ + %PIP_EXTRA_ARGS% ^ + %CFG_REQUIREMENTS% + + +"%CFG_BIN_DIR%\pip" install ^ --upgrade ^ --no-build-isolation ^ %CFG_QUIET% ^ @@ -163,7 +171,7 @@ if %ERRORLEVEL% neq 0 ( if exist "%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\bin" ( rmdir /s /q "%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\bin" ) -mklink /J %CFG_ROOT_DIR%\%VIRTUALENV_DIR%\bin %CFG_ROOT_DIR%\%VIRTUALENV_DIR%\Scripts +mklink /J "%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\bin" "%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\Scripts" if %ERRORLEVEL% neq 0 ( exit /b %ERRORLEVEL% From 311b0a16119f84c989ab1246c838c96a72fe4d06 Mon Sep 17 00:00:00 2001 From: Chin Yeung Li Date: Thu, 17 Feb 2022 17:32:40 +0800 Subject: [PATCH 2/3] Remove echo statement Signed-off-by: Chin Yeung Li --- configure.bat | 8 -------- 1 file changed, 8 deletions(-) diff --git a/configure.bat b/configure.bat index 7e80e98947..6f4496751b 100644 --- a/configure.bat +++ b/configure.bat @@ -152,14 +152,6 @@ if %ERRORLEVEL% neq 0 ( @rem # speeds up the installation. @rem # We always have the PEP517 build dependencies installed already. -echo "%CFG_BIN_DIR%\pip" install ^ - --upgrade ^ - --no-build-isolation ^ - %CFG_QUIET% ^ - %PIP_EXTRA_ARGS% ^ - %CFG_REQUIREMENTS% - - "%CFG_BIN_DIR%\pip" install ^ --upgrade ^ --no-build-isolation ^ From 35af6431aecf7eb19f73ea14b74955cc121464b9 Mon Sep 17 00:00:00 2001 From: Chin Yeung Li Date: Wed, 23 Feb 2022 15:42:00 +0800 Subject: [PATCH 3/3] Update configure.bat Signed-off-by: Chin Yeung Li --- configure.bat | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/configure.bat b/configure.bat index 6f4496751b..ed061613ee 100644 --- a/configure.bat +++ b/configure.bat @@ -52,9 +52,7 @@ set "CFG_BIN_DIR=%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\Scripts" if exist "%CFG_ROOT_DIR%\thirdparty" ( set PIP_EXTRA_ARGS=--find-links "%CFG_ROOT_DIR%\thirdparty" ) - -set "PIP_EXTRA_ARGS=%PIP_EXTRA_ARGS%" --find-links https://thirdparty.aboutcode.org/pypi & %INDEX_ARG% -@rem ################################ +set "PIP_EXTRA_ARGS=%PIP_EXTRA_ARGS% --find-links https://thirdparty.aboutcode.org/pypi" & %INDEX_ARG% @rem ################################ @@ -67,7 +65,7 @@ if not defined CFG_QUIET ( @rem ################################ @rem # Main command line entry point set CFG_DEV_MODE=0 -set CFG_REQUIREMENTS=%REQUIREMENTS% +set "CFG_REQUIREMENTS=%REQUIREMENTS%" set "NO_INDEX=--no-index" :again @@ -75,7 +73,7 @@ if not "%1" == "" ( if "%1" EQU "--help" (goto cli_help) if "%1" EQU "--clean" (goto clean) if "%1" EQU "--dev" ( - set CFG_REQUIREMENTS=%DEV_REQUIREMENTS% + set "CFG_REQUIREMENTS=%DEV_REQUIREMENTS%" set CFG_DEV_MODE=1 ) if "%1" EQU "--init" ( @@ -204,4 +202,4 @@ for %%F in (%CLEANABLE%) do ( rmdir /s /q "%CFG_ROOT_DIR%\%%F" >nul 2>&1 del /f /q "%CFG_ROOT_DIR%\%%F" >nul 2>&1 ) -exit /b 0 +exit /b 0 \ No newline at end of file