[oe-commits] Tom Rini : python-native: Mangle shebang-invoking scripts

git version control git at git.openembedded.org
Fri Jan 28 22:24:17 UTC 2011


Module: openembedded.git
Branch: org.openembedded.dev
Commit: dd33ced4b8123600efa1f67f704aec13b0842ad1
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=dd33ced4b8123600efa1f67f704aec13b0842ad1

Author: Tom Rini <tom_rini at mentor.com>
Date:   Fri Jan 28 15:22:44 2011 -0700

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 at mentor.com>

---

 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 51a1fb1..0fd6dcb 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 eb487a9..c2a1cec 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}/
 }





More information about the Openembedded-commits mailing list