Patchwork [2/4] python-native: add nativepython symlink

login
register
mail settings
Submitter Ross Burton
Date June 12, 2013, 4:49 p.m.
Message ID <4675c2ea4d21c1e7b9291698ba4b30750187efde.1371055550.git.ross.burton@intel.com>
Download mbox | patch
Permalink /patch/51611/
State Accepted
Commit d99dac66e3e121e96c4d8a29aee846d4b8f38622
Headers show

Comments

Ross Burton - June 12, 2013, 4:49 p.m.
Add a symlink to the native Python so that scripts can just invoke
"nativepython" and get the right one without needing absolute paths (these often
end up too long for the #! parser in the kernel as the buffer is 128 bytes
long).

The name "nativepython" was chosen to match the existing "nativeperl" which
serves the same purpose.

Signed-off-by: Ross Burton <ross.burton@intel.com>
---
 meta/recipes-devtools/python/python-native_2.7.3.bb |    6 ++++++
 1 file changed, 6 insertions(+)

Patch

diff --git a/meta/recipes-devtools/python/python-native_2.7.3.bb b/meta/recipes-devtools/python/python-native_2.7.3.bb
index 722d92c..39d53bb 100644
--- a/meta/recipes-devtools/python/python-native_2.7.3.bb
+++ b/meta/recipes-devtools/python/python-native_2.7.3.bb
@@ -48,4 +48,10 @@  do_install() {
 	for PYTHSCRIPT in `grep -rIl ${bindir}/${PN}/python ${D}${bindir}/${PN}`; do
 		sed -i -e '1s|^#!.*|#!/usr/bin/env python|' $PYTHSCRIPT
 	done
+
+	# Add a symlink to the native Python so that scripts can just invoke
+	# "nativepython" and get the right one without needing absolute paths
+	# (these often end up too long for the #! parser in the kernel as the
+	# buffer is 128 bytes long).
+	ln -s python-native/python ${D}${bindir}/nativepython
 }