aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Rini <tom_rini@mentor.com>2011-01-28 15:22:44 -0700
committerTom Rini <tom_rini@mentor.com>2011-01-28 15:22:44 -0700
commitdd33ced4b8123600efa1f67f704aec13b0842ad1 (patch)
treeb64572f2fc12f4d5796aecb8ebc79c56ef642d56
parent6bf99a5ba5ea856bc18a452608ae7ca767e2bf5e (diff)
downloadopenembedded-dd33ced4b8123600efa1f67f704aec13b0842ad1.tar.gz
python-native: Mangle shebang-invoking scripts
Need to make sure python*-config is invokable even in deep path builds. Signed-off-by: Tom Rini <tom_rini@mentor.com>
-rw-r--r--recipes/python/python-native_2.6.5.bb7
-rw-r--r--recipes/python/python-native_2.7.1.bb7
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}/
}