tests/lcitool: Do not use a hard-coded /usr/bin/python3 as python interpreter
PATCH 1/1 tests/lcitool: Do not use a hard-coded /usr/bin/python3 as python interpreter
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.
--- tests/lcitool/Makefile.include | 2 +- tests/lcitool/refresh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
tests/lcitool/Makefile.include +1 -1
@@ -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))
tests/lcitool/refresh +1 -1
@@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 # # Re-generate container recipes #
Signature · 1 line
2.27.0
Quoted 8 lines · Thomas Huth
When running "make lcitool-refresh", this currently uses the hard-coded
/usr/bin/python3from the script's shebang line for running Python. That's bad, since neither/usr/bin/python3is 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 theMakefile, and improve the shebang line in the script in case someone runs this directly.
Quoted 5 lines
Signed-off-by Thomas Huth <[email protected]>--- tests/lcitool/Makefile.include | 2 +- tests/lcitool/refresh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
With regards,
Daniel
Signature · 3 lines
|: 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 :|
Quoted 8 lines · Thomas Huth
When running "make lcitool-refresh", this currently uses the hard-coded
/usr/bin/python3from the script's shebang line for running Python. That's bad, since neither/usr/bin/python3is 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 theMakefile, and improve the shebang line in the script in case someone runs this directly.
Quoted 5 lines
Signed-off-by Thomas Huth <[email protected]>--- tests/lcitool/Makefile.include | 2 +- tests/lcitool/refresh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Laurent Vivier
AppliedLe 29/03/2022 à 08:39, Thomas Huth a écrit :
Quoted 29 lines
When running "make lcitool-refresh", this currently uses the hard-coded
/usr/bin/python3from the script's shebang line for running Python. That's bad, since neither/usr/bin/python3is 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 theMakefile, and improve the shebang line in the script in case someone runs this directly.Signed-off-by Thomas Huth <[email protected]>--- tests/lcitool/Makefile.include | 2 +- tests/lcitool/refresh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)tests/lcitool/Makefile.include +1
-1@@ -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))tests/lcitool/refresh +0
-0
tests/lcitool/refresh line 4
Quoted 5 lines
tests/lcitool/refresh +1
-1@@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 # # Re-generate container recipes #
Applied to my trivial-patches branch.
Thanks,
Laurent