]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] gh-107814: Avoid output from Nuget installation in find_python.bat (GH-107815)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 9 Aug 2023 23:15:43 +0000 (16:15 -0700)
committerGitHub <noreply@github.com>
Wed, 9 Aug 2023 23:15:43 +0000 (23:15 +0000)
gh-107814: Avoid output from Nuget installation in find_python.bat (GH-107815)
(cherry picked from commit 1e229e2c3d212accbd5fbe3a46cd42f8252b2868)

Co-authored-by: Max Bachmann <kontakt@maxbachmann.de>
Misc/NEWS.d/next/Build/2023-08-09-17-05-33.gh-issue-107814.c0Oapq.rst [new file with mode: 0644]
PCbuild/find_python.bat

diff --git a/Misc/NEWS.d/next/Build/2023-08-09-17-05-33.gh-issue-107814.c0Oapq.rst b/Misc/NEWS.d/next/Build/2023-08-09-17-05-33.gh-issue-107814.c0Oapq.rst
new file mode 100644 (file)
index 0000000..d372335
--- /dev/null
@@ -0,0 +1 @@
+When calling ``find_python.bat`` with ``-q`` it did not properly silence the output of nuget. That is now fixed.
index 11d6cba7a172c958d919fc616f50918f12786db7..31579e088e4707faed286031449f608683b80fe5 100644 (file)
@@ -52,7 +52,7 @@
 @if "%_Py_NUGET%"=="" (set _Py_NUGET=%_Py_EXTERNALS_DIR%\nuget.exe)
 @if "%_Py_NUGET_URL%"=="" (set _Py_NUGET_URL=https://aka.ms/nugetclidl)
 @if NOT exist "%_Py_NUGET%" (
-    @echo Downloading nuget...
+    @if not "%_Py_Quiet%"=="1" @echo Downloading nuget...
     @rem NB: Must use single quotes around NUGET here, NOT double!
     @rem Otherwise, a space in the path would break things
     @rem If it fails, retry with any available copy of Python
 )
 
 @if not "%_Py_Quiet%"=="1" @echo Installing Python via nuget...
-@"%_Py_NUGET%" install pythonx86 -ExcludeVersion -OutputDirectory "%_Py_EXTERNALS_DIR%"
+@if not "%_Py_Quiet%"=="1" (
+    @"%_Py_NUGET%" install pythonx86 -ExcludeVersion -OutputDirectory "%_Py_EXTERNALS_DIR%"
+) else (
+    @"%_Py_NUGET%" install pythonx86 -Verbosity quiet -ExcludeVersion -OutputDirectory "%_Py_EXTERNALS_DIR%"
+)
 @rem Quote it here; it's not quoted later because "py -x.y" wouldn't work
 @if not errorlevel 1 (set PYTHON="%_Py_EXTERNALS_DIR%\pythonx86\tools\python.exe") & (set _Py_Python_Source=found on nuget.org) & goto :found