Skip to contentSkip to conversation

python: fix interpreter directive for python scripts

PATCH New Jonathan Liu 2 participants 2 messages Aug 11, 2012 – Aug 22, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 python: fix interpreter directive for python scripts

---
 package/python/python.mk | 7 +++++++
 1 file changed, 7 insertions(+)
package/python/python.mk +7 -0
index fae4e5c..783b7b8 100644
@@ -165,6 +165,13 @@ endef
 
 PYTHON_POST_INSTALL_TARGET_HOOKS += PYTHON_REMOVE_USELESS_FILES
 
+# Fix Python interpreter directive
+define PYTHON_FIX_INTERPRETER
+        sed -i '1s|#!.*python.*|#!/usr/bin/env python|' $(TARGET_DIR)/usr/bin/{easy_install,easy_install-2.7,idle,smtpd.py}
+endef
+
+PYTHON_POST_INSTALL_TARGET_HOOKS += PYTHON_FIX_INTERPRETER
+
 PYTHON_AUTORECONF = YES
 
 $(eval $(autotools-package))
Signature · 1 line
1.7.11.3
#1 lore raw

PATCH 1/1 python: fix interpreter directive for python scripts

Hi,

Le 11/08/2012 07:43, Jonathan Liu a ?crit :

package/python/python.mk endef · line 174

Quoted 7 lines
package/python/python.mk +7 -0
+# Fix Python interpreter directive
+define PYTHON_FIX_INTERPRETER
+        sed -i '1s|#!.*python.*|#!/usr/bin/env python|' $(TARGET_DIR)/usr/bin/{easy_install,easy_install-2.7,idle,smtpd.py}
+endef
+
+PYTHON_POST_INSTALL_TARGET_HOOKS += PYTHON_FIX_INTERPRETER
+

Could you provide a bit more input on why this patch is needed ? Did you encounter a bug? Which one?

Thanks,

Signature · 4 lines
Maxime Ripard, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com