Skip to content

Commit e1f6805

Browse files
committed
Fixes argument handling in build.bat and HHC search
1 parent c79dbc7 commit e1f6805

2 files changed

Lines changed: 21 additions & 24 deletions

File tree

Doc/make.bat

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,13 @@ where hhc /q && set HTMLHELP=hhc && goto :skiphhcsearch
1717
where /R ..\externals hhc > "%TEMP%\hhc.loc" 2> nul && set /P HTMLHELP= < "%TEMP%\hhc.loc" & del "%TEMP%\hhc.loc"
1818
if not exist "%HTMLHELP%" where /R "%ProgramFiles(x86)%" hhc > "%TEMP%\hhc.loc" 2> nul && set /P HTMLHELP= < "%TEMP%\hhc.loc" & del "%TEMP%\hhc.loc"
1919
if not exist "%HTMLHELP%" where /R "%ProgramFiles%" hhc > "%TEMP%\hhc.loc" 2> nul && set /P HTMLHELP= < "%TEMP%\hhc.loc" & del "%TEMP%\hhc.loc"
20-
if not exist "%HTMLHELP%" echo Cannot find HHC on PATH or in externals & exit /B 1
20+
if not exist "%HTMLHELP%" (
21+
echo.
22+
echo.The HTML Help Workshop was not found. Set the HTMLHELP variable
23+
echo.to the path to hhc.exe or download and install it from
24+
echo.http://msdn.microsoft.com/en-us/library/ms669985
25+
exit /B 1
26+
)
2127
:skiphhcsearch
2228

2329
if "%DISTVERSION%" EQU "" for /f "usebackq" %%v in (`%PYTHON% tools/extensions/patchlevel.py`) do set DISTVERSION=%%v
@@ -85,15 +91,6 @@ if NOT "%PAPER%" == "" (
8591
cmd /C %SPHINXBUILD% %SPHINXOPTS% -b%1 -dbuild\doctrees . %BUILDDIR%\%*
8692

8793
if "%1" EQU "htmlhelp" (
88-
if not exist "%HTMLHELP%" (
89-
echo.
90-
echo.The HTML Help Workshop was not found. Set the HTMLHELP variable
91-
echo.to the path to hhc.exe or download and install it from
92-
echo.http://msdn.microsoft.com/en-us/library/ms669985
93-
rem Set errorlevel to 1 and exit
94-
cmd /C exit /b 1
95-
goto end
96-
)
9794
cmd /C "%HTMLHELP%" build\htmlhelp\python%DISTVERSION:.=%.hhp
9895
rem hhc.exe seems to always exit with code 1, reset to 0 for less than 2
9996
if not errorlevel 2 cmd /C exit /b 0

PCbuild/build.bat

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,24 @@ set verbose=/nologo /v:m
2525
set kill=
2626

2727
:CheckOpts
28-
if '%~1'=='-c' (set conf=%2) & shift & shift & goto CheckOpts
29-
if '%~1'=='-p' (set platf=%2) & shift & shift & goto CheckOpts
30-
if '%~1'=='-r' (set target=Rebuild) & shift & goto CheckOpts
31-
if '%~1'=='-t' (set target=%2) & shift & shift & goto CheckOpts
32-
if '%~1'=='-d' (set conf=Debug) & shift & goto CheckOpts
33-
if '%~1'=='-e' call "%dir%get_externals.bat" & shift & goto CheckOpts
34-
if '%~1'=='-m' (set parallel=/m) & shift & goto CheckOpts
35-
if '%~1'=='-M' (set parallel=) & shift & goto CheckOpts
36-
if '%~1'=='-v' (set verbose=/v:n) & shift & goto CheckOpts
37-
if '%~1'=='-k' (set kill=true) & shift & goto CheckOpts
38-
if '%~1'=='-V' shift & goto Version
39-
40-
if '%platf%'=='x64' (set vs_platf=x86_amd64)
28+
if "%~1"=="-c" (set conf=%2) & shift & shift & goto CheckOpts
29+
if "%~1"=="-p" (set platf=%2) & shift & shift & goto CheckOpts
30+
if "%~1"=="-r" (set target=Rebuild) & shift & goto CheckOpts
31+
if "%~1"=="-t" (set target=%2) & shift & shift & goto CheckOpts
32+
if "%~1"=="-d" (set conf=Debug) & shift & goto CheckOpts
33+
if "%~1"=="-e" call "%dir%get_externals.bat" & shift & goto CheckOpts
34+
if "%~1"=="-m" (set parallel=/m) & shift & goto CheckOpts
35+
if "%~1"=="-M" (set parallel=) & shift & goto CheckOpts
36+
if "%~1"=="-v" (set verbose=/v:n) & shift & goto CheckOpts
37+
if "%~1"=="-k" (set kill=true) & shift & goto CheckOpts
38+
if "%~1"=="-V" shift & goto Version
39+
40+
if "%platf%"=="x64" (set vs_platf=x86_amd64)
4141

4242
rem Setup the environment
4343
call "%dir%env.bat" %vs_platf% >nul
4444

45-
if '%kill%'=='true' (
45+
if "%kill%"=="true" (
4646
msbuild /v:m /nologo /target:KillPython "%pcbuild%\pythoncore.vcxproj" /p:Configuration=%conf% /p:Platform=%platf% /p:KillPython=true
4747
)
4848

0 commit comments

Comments
 (0)