tests/lcitool: Do not use a hard-coded /usr/bin/python3 as python interpreter
authorThomas Huth <thuth@redhat.com>
Tue, 29 Mar 2022 06:39:58 +0000 (08:39 +0200)
committerLaurent Vivier <laurent@vivier.eu>
Thu, 31 Mar 2022 19:32:49 +0000 (21:32 +0200)
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>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20220329063958.262669-1-thuth@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
tests/lcitool/Makefile.include
tests/lcitool/refresh

index 6b215adcd1e05bdf76c585d3d3184644eb09a40e..3780185c7c450f66f1fbf6f259150e78251c4681 100644 (file)
@@ -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))
index 1f00281b443dcbc862c2711f54d974c6cae01889..2d198ad281a0e2a66e8ba782208ec532268f48ef 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/env python3
 #
 # Re-generate container recipes
 #