Skip to contentSkip to conversation

python: fix interpreter directive for python scripts

PATCH New Jonathan Liu 1 participant 1 message Aug 12, 2012

lore
Share & tools
lore
#0 lore raw

PATCH v2 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..98f6588 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/{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