[OE-core] [meta-oe][PATCH] itstool: Use python3 binary fom PATH instead of /usr/bin/python3

Piotr Tworek tworaz at tworaz.net
Fri Jul 26 15:39:27 UTC 2019


Although /usr/bin/python3 works fine for class-target builds its not
really what we want for class-native. The host system might not even
have python3 installed. The native itstool version should use pythn3
provided in recipe-sysroot-native. To accomplish it modify the default
shebang to use /usr/bin/env. This works as expected for both native and
target builds.

Signed-off-by: Piotr Tworek <tworaz at tworaz.net>
---
 meta-oe/recipes-support/itstool/itstool_2.0.5.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta-oe/recipes-support/itstool/itstool_2.0.5.bb b/meta-oe/recipes-support/itstool/itstool_2.0.5.bb
index a0af44a71..f21e7f39b 100644
--- a/meta-oe/recipes-support/itstool/itstool_2.0.5.bb
+++ b/meta-oe/recipes-support/itstool/itstool_2.0.5.bb
@@ -13,7 +13,7 @@ SRC_URI[sha256sum] = "100506f8df62cca6225ec3e631a8237e9c04650c77495af4919ac6a100
 
 do_install_append() {
     # fix shebang of main script
-    sed -i 's:^#!${WORKDIR}.*${PYTHON_PN} -s:#!${bindir_native}/${PYTHON_PN} -s:' ${D}${bindir}/itstool
+    sed -i 's:^#!${WORKDIR}.*${PYTHON_PN} -s:#!${bindir_native}/env -S ${PYTHON_PN} -s:' ${D}${bindir}/itstool
 }
 
 BBCLASSEXTEND = "native"
-- 
2.21.0



More information about the Openembedded-core mailing list