* [PATCH] tests/lcitool: Do not use a hard-coded /usr/bin/python3 as python interpreter
@ 2022-03-29 6:39 Thomas Huth
2022-03-29 9:04 ` Daniel P. Berrangé
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Thomas Huth @ 2022-03-29 6:39 UTC (permalink / raw)
To: qemu-devel
Cc: Daniel P . Berrange, Beraldo Leal, qemu-trivial,
Philippe Mathieu-Daudé, Wainer dos Santos Moschetta,
Alex Bennée
When running "make lcitool-refresh", this currently uses the hard-coded
/usr/bin/python3 from the script's shebang line for running Python.
That's bad, since neither /usr/bin/python3 is guaranteed to exist, nor
does it honor the python interpreter that the user might have chosen
while running the "configure" script. Thus let's rather use $(PYTHON)
in the Makefile, and improve the shebang line in the script in case
someone runs this directly.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/lcitool/Makefile.include | 2 +-
tests/lcitool/refresh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/lcitool/Makefile.include b/tests/lcitool/Makefile.include
index 6b215adcd1..3780185c7c 100644
--- a/tests/lcitool/Makefile.include
+++ b/tests/lcitool/Makefile.include
@@ -14,4 +14,4 @@ lcitool-help: lcitool
lcitool-refresh:
$(call quiet-command, cd $(SRC_PATH) && git submodule update --init tests/lcitool/libvirt-ci)
- $(call quiet-command, $(LCITOOL_REFRESH))
+ $(call quiet-command, $(PYTHON) $(LCITOOL_REFRESH))
diff --git a/tests/lcitool/refresh b/tests/lcitool/refresh
index 1f00281b44..2d198ad281 100755
--- a/tests/lcitool/refresh
+++ b/tests/lcitool/refresh
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/env python3
#
# Re-generate container recipes
#
--
2.27.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] tests/lcitool: Do not use a hard-coded /usr/bin/python3 as python interpreter
2022-03-29 6:39 [PATCH] tests/lcitool: Do not use a hard-coded /usr/bin/python3 as python interpreter Thomas Huth
@ 2022-03-29 9:04 ` Daniel P. Berrangé
2022-03-29 10:18 ` Philippe Mathieu-Daudé
2022-03-31 19:33 ` Laurent Vivier
2 siblings, 0 replies; 4+ messages in thread
From: Daniel P. Berrangé @ 2022-03-29 9:04 UTC (permalink / raw)
To: Thomas Huth
Cc: Beraldo Leal, qemu-trivial, qemu-devel,
Wainer dos Santos Moschetta, Philippe Mathieu-Daudé,
Alex Bennée
On Tue, Mar 29, 2022 at 08:39:58AM +0200, Thomas Huth wrote:
> When running "make lcitool-refresh", this currently uses the hard-coded
> /usr/bin/python3 from the script's shebang line for running Python.
> That's bad, since neither /usr/bin/python3 is guaranteed to exist, nor
> does it honor the python interpreter that the user might have chosen
> while running the "configure" script. Thus let's rather use $(PYTHON)
> in the Makefile, and improve the shebang line in the script in case
> someone runs this directly.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
> tests/lcitool/Makefile.include | 2 +-
> tests/lcitool/refresh | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] tests/lcitool: Do not use a hard-coded /usr/bin/python3 as python interpreter
2022-03-29 6:39 [PATCH] tests/lcitool: Do not use a hard-coded /usr/bin/python3 as python interpreter Thomas Huth
2022-03-29 9:04 ` Daniel P. Berrangé
@ 2022-03-29 10:18 ` Philippe Mathieu-Daudé
2022-03-31 19:33 ` Laurent Vivier
2 siblings, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2022-03-29 10:18 UTC (permalink / raw)
To: Thomas Huth, qemu-devel
Cc: Daniel P . Berrange, Beraldo Leal, qemu-trivial,
Philippe Mathieu-Daudé, Wainer dos Santos Moschetta,
Alex Bennée
On 29/3/22 08:39, Thomas Huth wrote:
> When running "make lcitool-refresh", this currently uses the hard-coded
> /usr/bin/python3 from the script's shebang line for running Python.
> That's bad, since neither /usr/bin/python3 is guaranteed to exist, nor
> does it honor the python interpreter that the user might have chosen
> while running the "configure" script. Thus let's rather use $(PYTHON)
> in the Makefile, and improve the shebang line in the script in case
> someone runs this directly.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
> tests/lcitool/Makefile.include | 2 +-
> tests/lcitool/refresh | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] tests/lcitool: Do not use a hard-coded /usr/bin/python3 as python interpreter
2022-03-29 6:39 [PATCH] tests/lcitool: Do not use a hard-coded /usr/bin/python3 as python interpreter Thomas Huth
2022-03-29 9:04 ` Daniel P. Berrangé
2022-03-29 10:18 ` Philippe Mathieu-Daudé
@ 2022-03-31 19:33 ` Laurent Vivier
2 siblings, 0 replies; 4+ messages in thread
From: Laurent Vivier @ 2022-03-31 19:33 UTC (permalink / raw)
To: Thomas Huth, qemu-devel
Cc: Daniel P . Berrange, Beraldo Leal, qemu-trivial,
Philippe Mathieu-Daudé, Wainer dos Santos Moschetta,
Alex Bennée
Le 29/03/2022 à 08:39, Thomas Huth a écrit :
> When running "make lcitool-refresh", this currently uses the hard-coded
> /usr/bin/python3 from the script's shebang line for running Python.
> That's bad, since neither /usr/bin/python3 is guaranteed to exist, nor
> does it honor the python interpreter that the user might have chosen
> while running the "configure" script. Thus let's rather use $(PYTHON)
> in the Makefile, and improve the shebang line in the script in case
> someone runs this directly.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
> tests/lcitool/Makefile.include | 2 +-
> tests/lcitool/refresh | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tests/lcitool/Makefile.include b/tests/lcitool/Makefile.include
> index 6b215adcd1..3780185c7c 100644
> --- a/tests/lcitool/Makefile.include
> +++ b/tests/lcitool/Makefile.include
> @@ -14,4 +14,4 @@ lcitool-help: lcitool
>
> lcitool-refresh:
> $(call quiet-command, cd $(SRC_PATH) && git submodule update --init tests/lcitool/libvirt-ci)
> - $(call quiet-command, $(LCITOOL_REFRESH))
> + $(call quiet-command, $(PYTHON) $(LCITOOL_REFRESH))
> diff --git a/tests/lcitool/refresh b/tests/lcitool/refresh
> index 1f00281b44..2d198ad281 100755
> --- a/tests/lcitool/refresh
> +++ b/tests/lcitool/refresh
> @@ -1,4 +1,4 @@
> -#!/usr/bin/python3
> +#!/usr/bin/env python3
> #
> # Re-generate container recipes
> #
Applied to my trivial-patches branch.
Thanks,
Laurent
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-03-31 19:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-29 6:39 [PATCH] tests/lcitool: Do not use a hard-coded /usr/bin/python3 as python interpreter Thomas Huth
2022-03-29 9:04 ` Daniel P. Berrangé
2022-03-29 10:18 ` Philippe Mathieu-Daudé
2022-03-31 19:33 ` Laurent Vivier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).