Patchwork python: fix interpreter directive for python scripts

login
register
mail settings
Submitter Jonathan Liu
Date Aug. 11, 2012, 5:43 a.m.
Message ID <1344663795-26449-1-git-send-email-net147@gmail.com>
Download mbox | patch
Permalink /patch/176661/
State Rejected
Headers show

Comments

Jonathan Liu - Aug. 11, 2012, 5:43 a.m.
Signed-off-by: Jonathan Liu <net147@gmail.com>
---
 package/python/python.mk | 7 +++++++
 1 file changed, 7 insertions(+)
Maxime Ripard - Aug. 22, 2012, 7:17 a.m.
Hi,

Le 11/08/2012 07:43, Jonathan Liu a écrit :
> +# 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,

Patch

diff --git a/package/python/python.mk b/package/python/python.mk
index fae4e5c..783b7b8 100644
--- a/package/python/python.mk
+++ b/package/python/python.mk
@@ -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))