[PATCH] meson: Use subprocess.check_output()

Akihiko Odaki posted 1 patch 9 months, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20230812091111.13411-1-akihiko.odaki@daynix.com
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Thomas Huth <thuth@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, John Snow <jsnow@redhat.com>, Cleber Rosa <crosa@redhat.com>
scripts/symlink-install-tree.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
[PATCH] meson: Use subprocess.check_output()
Posted by Akihiko Odaki 9 months, 1 week ago
subprocess.check_output() is a more concise way to execute a subprocess
here.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
Based-on: <20230812061540.5398-1-akihiko.odaki@daynix.com>
("[PATCH] meson: Fix MESONINTROSPECT parsing")

 scripts/symlink-install-tree.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/scripts/symlink-install-tree.py b/scripts/symlink-install-tree.py
index b72563895c..56d603588f 100644
--- a/scripts/symlink-install-tree.py
+++ b/scripts/symlink-install-tree.py
@@ -15,8 +15,7 @@ def destdir_join(d1: str, d2: str) -> str:
     return str(PurePath(d1, *PurePath(d2).parts[1:]))
 
 introspect = os.environ.get('MESONINTROSPECT')
-out = subprocess.run([*shlex.split(introspect), '--installed'],
-                     stdout=subprocess.PIPE, check=True).stdout
+out = subprocess.check_output([*shlex.split(introspect), '--installed'])
 for source, dest in json.loads(out).items():
     bundle_dest = destdir_join('qemu-bundle', dest)
     path = os.path.dirname(bundle_dest)
-- 
2.41.0
Re: [PATCH] meson: Use subprocess.check_output()
Posted by Thomas Huth 9 months ago
On 12/08/2023 11.11, Akihiko Odaki wrote:
> subprocess.check_output() is a more concise way to execute a subprocess
> here.
> 
> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
> ---
> Based-on: <20230812061540.5398-1-akihiko.odaki@daynix.com>
> ("[PATCH] meson: Fix MESONINTROSPECT parsing")

Since that other patch has never been merged, this patch here does not apply 
to master ... could you maybe respin it for the plain master branch?

  Thomas
Re: [PATCH] meson: Use subprocess.check_output()
Posted by Michael Tokarev 9 months ago
23.08.2023 11:33, Thomas Huth wrote:
> On 12/08/2023 11.11, Akihiko Odaki wrote:
>> subprocess.check_output() is a more concise way to execute a subprocess
>> here.
>>
>> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
>> ---
>> Based-on: <20230812061540.5398-1-akihiko.odaki@daynix.com>
>> ("[PATCH] meson: Fix MESONINTROSPECT parsing")
> 
> Since that other patch has never been merged, this patch here does not apply to master ... could you maybe respin it for the plain master branch?

Both patches should be applied, that one first, this one second.
I don't think it needs a respin, just a proper patch series.

/mjt
Re: [PATCH] meson: Use subprocess.check_output()
Posted by Thomas Huth 9 months ago
On 23/08/2023 10.36, Michael Tokarev wrote:
> 23.08.2023 11:33, Thomas Huth wrote:
>> On 12/08/2023 11.11, Akihiko Odaki wrote:
>>> subprocess.check_output() is a more concise way to execute a subprocess
>>> here.
>>>
>>> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
>>> ---
>>> Based-on: <20230812061540.5398-1-akihiko.odaki@daynix.com>
>>> ("[PATCH] meson: Fix MESONINTROSPECT parsing")
>>
>> Since that other patch has never been merged, this patch here does not 
>> apply to master ... could you maybe respin it for the plain master branch?
> 
> Both patches should be applied, that one first, this one second.
> I don't think it needs a respin, just a proper patch series.

Ok, I'll try to pick both patches for my next pull request.

  Thomas
Re: [PATCH] meson: Use subprocess.check_output()
Posted by Thomas Huth 9 months ago
On 23/08/2023 10.42, Thomas Huth wrote:
> On 23/08/2023 10.36, Michael Tokarev wrote:
>> 23.08.2023 11:33, Thomas Huth wrote:
>>> On 12/08/2023 11.11, Akihiko Odaki wrote:
>>>> subprocess.check_output() is a more concise way to execute a subprocess
>>>> here.
>>>>
>>>> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
>>>> ---
>>>> Based-on: <20230812061540.5398-1-akihiko.odaki@daynix.com>
>>>> ("[PATCH] meson: Fix MESONINTROSPECT parsing")
>>>
>>> Since that other patch has never been merged, this patch here does not 
>>> apply to master ... could you maybe respin it for the plain master branch?
>>
>> Both patches should be applied, that one first, this one second.
>> I don't think it needs a respin, just a proper patch series.
> 
> Ok, I'll try to pick both patches for my next pull request.

Ah, no, Akihiko said "Please do NOT merge this" on the other patch, so let's 
wait 'til the issue with Windows has been resolved first.

  Thomas
Re: [PATCH] meson: Use subprocess.check_output()
Posted by Michael Tokarev 9 months, 1 week ago
12.08.2023 12:11, Akihiko Odaki wrote:
> subprocess.check_output() is a more concise way to execute a subprocess
> here.
> 
> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
> ---
> Based-on: <20230812061540.5398-1-akihiko.odaki@daynix.com>
> ("[PATCH] meson: Fix MESONINTROSPECT parsing")
> 
>   scripts/symlink-install-tree.py | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/scripts/symlink-install-tree.py b/scripts/symlink-install-tree.py
> index b72563895c..56d603588f 100644
> --- a/scripts/symlink-install-tree.py
> +++ b/scripts/symlink-install-tree.py
> @@ -15,8 +15,7 @@ def destdir_join(d1: str, d2: str) -> str:
>       return str(PurePath(d1, *PurePath(d2).parts[1:]))
>   
>   introspect = os.environ.get('MESONINTROSPECT')
> -out = subprocess.run([*shlex.split(introspect), '--installed'],
> -                     stdout=subprocess.PIPE, check=True).stdout
> +out = subprocess.check_output([*shlex.split(introspect), '--installed'])
>   for source, dest in json.loads(out).items():
>       bundle_dest = destdir_join('qemu-bundle', dest)
>       path = os.path.dirname(bundle_dest)

Yes, this works too and is shorter and easier to read.

Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Tested-by: Michael Tokarev <mjt@tls.msk.ru>

Thanks!

/mjt