Skip to content

Commit

Permalink
Refactor some for loops that worked by accident
Browse files Browse the repository at this point in the history
  • Loading branch information
pal1000 committed Nov 5, 2021
1 parent 0019d2b commit a4841b1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
git clone --depth=1 https://swiftshader.googlesource.com/SwiftShader swiftshader
git clone https://github.com/pal1000/swiftshader-dist-win.git swiftshader-dist-win
cd swiftshader-dist-win
git checkout 1.0.6d
git checkout 1.0.6e
cd ..
displayName: Get sources
- script: swiftshader-dist-win\buildscript\ci\ci.cmd collectuids
Expand Down
16 changes: 8 additions & 8 deletions buildscript/modules/discoverpython.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
@set pythontotal=0
@IF %cimode% EQU 0 cls
@IF %cimode% EQU 1 echo.
@FOR /F tokens^=1-3^ skip^=1^ delims^=.-^ %%a IN ('py -0 2^>nul') do @(
@FOR /F tokens^=2-3^ skip^=1^ delims^=- %%a IN ('py -0 2^>nul') do @FOR /F tokens^=1-2^ delims^=. %%c IN ("%%a") do @(
@set goodpython=1
@if %%a LSS 3 set goodpython=0
@if %%a EQU 3 if %%b LSS 5 set goodpython=0
@if %%c LSS 3 set goodpython=0
@if %%c EQU 3 if %%d LSS 5 set goodpython=0
@IF !goodpython!==1 set /a pythontotal+=1
@IF !pythontotal!==1 echo Select Python installation
@IF !goodpython!==1 echo !pythontotal!. Python %%a.%%b %%c bit
@IF !goodpython!==1 echo !pythontotal!. Python %%a %%b bit
)
@IF %pythontotal%==0 echo WARNING: No suitable Python installation found by Python launcher.
@IF %pythontotal%==0 echo Note that SwiftShader requires Python 3.x.
Expand All @@ -48,12 +48,12 @@

@rem Locate selected Python installation
@set pythoncount=0
@FOR /F tokens^=1-3^ skip^=1^ delims^=.-^ %%a IN ('py -0 2^>nul') do @(
@FOR /F tokens^=2-3^ skip^=1^ delims^=- %%a IN ('py -0 2^>nul') do @FOR /F tokens^=1-2^ delims^=. %%c IN ("%%a") do @(
@set goodpython=1
@if %%a LSS 3 set goodpython=0
@if %%a EQU 3 if %%b LSS 5 set goodpython=0
@if %%c LSS 3 set goodpython=0
@if %%c EQU 3 if %%d LSS 5 set goodpython=0
@IF !goodpython!==1 set /a pythoncount+=1
@IF !pythoncount!==%pyselect% set selectedpython=-%%a.%%b-%%c
@IF !pythoncount!==%pyselect% set selectedpython=-%%a-%%b
)
@FOR /F "tokens=* USEBACKQ" %%a IN (`py %selectedpython% -c "import sys; print(sys.executable)"`) DO @set pythonloc=%%~sa
@GOTO loadpypath
Expand Down

0 comments on commit a4841b1

Please sign in to comment.