From dd33ced4b8123600efa1f67f704aec13b0842ad1 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Fri, 28 Jan 2011 15:22:44 -0700 Subject: [PATCH] python-native: Mangle shebang-invoking scripts Need to make sure python*-config is invokable even in deep path builds. Signed-off-by: Tom Rini --- recipes/python/python-native_2.6.5.bb | 7 ++++++- recipes/python/python-native_2.7.1.bb | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/recipes/python/python-native_2.6.5.bb b/recipes/python/python-native_2.6.5.bb index 51a1fb1b56..0fd6dcbbca 100644 --- a/recipes/python/python-native_2.6.5.bb +++ b/recipes/python/python-native_2.6.5.bb @@ -1,6 +1,6 @@ require python.inc DEPENDS = "openssl-native bzip2-full-native zlib-native readline-native sqlite3-native" -PR = "${INC_PR}.1" +PR = "${INC_PR}.2" FILESPATHPKG .= ":python-${PV}:python" SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.bz2 \ @@ -37,4 +37,9 @@ do_install() { oe_runmake 'DESTDIR=${D}' install install -d ${D}${bindir}/ install -m 0755 Parser/pgen ${D}${bindir}/ + + # Make sure we use /usr/bin/env python + for PYTHSCRIPT in `grep -rIl ${bindir}/python ${D}${bindir}`; do + sed -i -e '1s|^#!.*|#!/usr/bin/env python|' $PYTHSCRIPT + done } diff --git a/recipes/python/python-native_2.7.1.bb b/recipes/python/python-native_2.7.1.bb index eb487a99a4..c2a1cec55a 100644 --- a/recipes/python/python-native_2.7.1.bb +++ b/recipes/python/python-native_2.7.1.bb @@ -1,6 +1,6 @@ require python2.7.inc DEPENDS = "openssl-native bzip2-full-native zlib-native readline-native sqlite3-native" -PR = "${INC_PR}.1" +PR = "${INC_PR}.2" FILESPATHPKG .= ":python-${PV}:python" SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.bz2 \ @@ -34,5 +34,10 @@ EXTRA_OEMAKE = '\ do_install() { oe_runmake 'DESTDIR=${D}' install install -d ${D}${bindir}/ + + # Make sure we use /usr/bin/env python + for PYTHSCRIPT in `grep -rIl ${bindir}/python ${D}${bindir}`; do + sed -i -e '1s|^#!.*|#!/usr/bin/env python|' $PYTHSCRIPT + done install -m 0755 Parser/pgen ${D}${bindir}/ } -- 2.39.5