From: Tom Rini Date: Fri, 28 Jan 2011 22:22:44 +0000 (-0700) Subject: python-native: Mangle shebang-invoking scripts X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dd33ced4b8123600efa1f67f704aec13b0842ad1;p=openembedded.git python-native: Mangle shebang-invoking scripts Need to make sure python*-config is invokable even in deep path builds. Signed-off-by: Tom Rini --- 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}/ }