Skip to contentSkip to conversation

python3: Substitute correct python version in shebang

PATCH Superseded Tyler Hall 3 participants 3 messages May 4, 2014 – May 5, 2014

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Tyler Hall

author
#0 lore raw

PATCH 1/1 python3: Substitute correct python version in shebang

If python2 and python3 are both available, scripts that are subject to this substitution can possibly run with the wrong python version. python3-config is one such script.

---
 meta/recipes-devtools/python/python3-native_3.3.3.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-devtools/python/python3-native_3.3.3.bb +1 -1
index 7238eaf..0fd7349 100644
@@ -71,6 +71,6 @@ do_install() {
 
 	# Make sure we use /usr/bin/env python
 	for PYTHSCRIPT in `grep -rIl ${bindir}/${PN}/python ${D}${bindir}/${PN}`; do
-		sed -i -e '1s|^#!.*|#!/usr/bin/env python|' $PYTHSCRIPT
+		sed -i -e '1s|^#!.*|#!/usr/bin/env python3|' $PYTHSCRIPT
 	done
 }
Signature · 1 line
1.9.2
#1 lore raw
Quoted 5 lines · Tyler Hall

If python2 and python3 are both available, scripts that are subject to this substitution can possibly run with the wrong python version. python3-config is one such script.

Thanks looks good to me.

Quoted 24 lines
---
 meta/recipes-devtools/python/python3-native_3.3.3.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-devtools/python/python3-native_3.3.3.bb +1 -2
index 7238eaf..0fd7349 100644
@@ -71,6 +71,6 @@ do_install() {
 
        # Make sure we use /usr/bin/env python
        for PYTHSCRIPT in `grep -rIl ${bindir}/${PN}/python ${D}${bindir}/${PN}`; do
-               sed -i -e '1s|^#!.*|#!/usr/bin/env python|' $PYTHSCRIPT
+               sed -i -e '1s|^#!.*|#!/usr/bin/env python3|' $PYTHSCRIPT
        done
 }
--

1.9.2

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#2 lore raw
In reply to Tyler Hall
Quoted 15 lines · Tyler Hall

If python2 and python3 are both available, scripts that are subject to this substitution can possibly run with the wrong python version. python3-config is one such script.

---
 meta/recipes-devtools/python/python3-native_3.3.3.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

python3-native_3.3.3.bb
index 7238eaf..0fd7349 100644

meta/recipes-devtools/python/python3-native_3.3.3.bb do_install() { · line 73

Quoted 3 lines
meta/recipes-devtools/python/python3-native_3.3.3.bb +0 -0
@@ -71,6 +71,6 @@ do_install() {
 
        # Make sure we use /usr/bin/env python
 

the comment above should perhaps be updated together with this change

Quoted 7 lines
meta/recipes-devtools/python/python3-native_3.3.3.bb +0 -0
        for PYTHSCRIPT in `grep -rIl ${bindir}/${PN}/python

${D}${bindir}/${PN}`; do

meta/recipes-devtools/python/python3-native_3.3.3.bb +1 -1
-               sed -i -e '1s|^#!.*|#!/usr/bin/env python|' $PYTHSCRIPT
+               sed -i -e '1s|^#!.*|#!/usr/bin/env python3|' $PYTHSCRIPT
        done
 }