2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-12-22 09:19:28 +01:00

waf.bat fixes

This commit is contained in:
Alibek Omarov 2023-03-27 23:18:37 +00:00 committed by Thomas Nagy
parent ff0a8cec14
commit d7da1547f7

View File

@ -5,17 +5,13 @@ rem from issue #964
Setlocal EnableDelayedExpansion Setlocal EnableDelayedExpansion
rem Check Windows Version rem Check Windows Version
set TOKEN=tokens=3* set TOKEN=tokens=2*
ver | findstr /i "5\.0\." > nul ver | findstr /i "5\.0\." > nul
if %ERRORLEVEL% EQU 0 SET TOKEN=tokens=3* if %ERRORLEVEL% EQU 0 SET TOKEN=tokens=3*
ver | findstr /i "5\.1\." > nul ver | findstr /i "5\.1\." > nul
if %ERRORLEVEL% EQU 0 SET TOKEN=tokens=3* if %ERRORLEVEL% EQU 0 SET TOKEN=tokens=3*
ver | findstr /i "5\.2\." > nul ver | findstr /i "5\.2\." > nul
if %ERRORLEVEL% EQU 0 SET TOKEN=tokens=3* if %ERRORLEVEL% EQU 0 SET TOKEN=tokens=3*
ver | findstr /i "6\.0\." > nul
if %ERRORLEVEL% EQU 0 SET TOKEN=tokens=2*
ver | findstr /i "6\.1\." > nul
if %ERRORLEVEL% EQU 0 SET TOKEN=tokens=2*
rem Start calculating PYTHON and PYTHON_DIR rem Start calculating PYTHON and PYTHON_DIR
set PYTHON= set PYTHON=
@ -26,7 +22,7 @@ Setlocal EnableDelayedExpansion
set PYTHON_DIR_OK=FALSE set PYTHON_DIR_OK=FALSE
set REGPATH= set REGPATH=
for %%i in (3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0 2.7 2.6 2.5) do ( for %%i in (3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0 2.7 2.6 2.5) do (
for %%j in (HKCU HKLM) do ( for %%j in (HKCU HKLM) do (
for %%k in (SOFTWARE\Wow6432Node SOFTWARE) do ( for %%k in (SOFTWARE\Wow6432Node SOFTWARE) do (
for %%l in (Python\PythonCore IronPython) do ( for %%l in (Python\PythonCore IronPython) do (
@ -77,7 +73,7 @@ Endlocal & SET PYTHON_DIR=%PYTHON_DIR% & SET PYTHON=%PYTHON%
if "%PYTHON_DIR%" == "" ( if "%PYTHON_DIR%" == "" (
rem @echo No Python dir rem @echo No Python dir
set PYTHON=python set PYTHON=py
goto running goto running
) )
@ -85,7 +81,7 @@ rem @echo %PYTHON_DIR%
if "%PYTHON%" == "" ( if "%PYTHON%" == "" (
rem @echo No Python rem @echo No Python
set PYTHON=python set PYTHON=py
goto running goto running
) )
@ -95,4 +91,4 @@ goto running
"%PYTHON%" -x "%~dp0waf" %* "%PYTHON%" -x "%~dp0waf" %*
Endlocal Endlocal
exit /b %ERRORLEVEL% exit /b %ERRORLEVEL%