Patchwork python3: Substitute correct python version in shebang

login
register
mail settings
Submitter Tyler Hall
Date May 4, 2014, 10:37 p.m.
Message ID <1399243070-25365-1-git-send-email-tylerwhall@gmail.com>
Download mbox | patch
Permalink /patch/71489/
State Accepted
Commit bb07e85810d93ca6019ef317bcf3bf794c968a6b
Headers show

Comments

Tyler Hall - May 4, 2014, 10:37 p.m.
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.

Signed-off-by: Tyler Hall <tylerwhall@gmail.com>
---
 meta/recipes-devtools/python/python3-native_3.3.3.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Khem Raj - May 5, 2014, 3:03 a.m.
On Sun, May 4, 2014 at 3:37 PM, Tyler Hall <tylerwhall@gmail.com> wrote:
> 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.
>
> Signed-off-by: Tyler Hall <tylerwhall@gmail.com>

Thanks looks good to me.

> ---
>  meta/recipes-devtools/python/python3-native_3.3.3.bb | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/recipes-devtools/python/python3-native_3.3.3.bb b/meta/recipes-devtools/python/python3-native_3.3.3.bb
> index 7238eaf..0fd7349 100644
> --- a/meta/recipes-devtools/python/python3-native_3.3.3.bb
> +++ b/meta/recipes-devtools/python/python3-native_3.3.3.bb
> @@ -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
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
Jacob Kroon - May 5, 2014, 4:04 a.m.
On Mon, May 5, 2014 at 12:37 AM, Tyler Hall <tylerwhall@gmail.com> wrote:

> 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.
>
> Signed-off-by: Tyler Hall <tylerwhall@gmail.com>
> ---
>  meta/recipes-devtools/python/python3-native_3.3.3.bb | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/recipes-devtools/python/python3-native_3.3.3.bbb/meta/recipes-devtools/python/
> python3-native_3.3.3.bb
> index 7238eaf..0fd7349 100644
> --- a/meta/recipes-devtools/python/python3-native_3.3.3.bb
> +++ b/meta/recipes-devtools/python/python3-native_3.3.3.bb
> @@ -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


>         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
>  }
>

Patch

diff --git a/meta/recipes-devtools/python/python3-native_3.3.3.bb b/meta/recipes-devtools/python/python3-native_3.3.3.bb
index 7238eaf..0fd7349 100644
--- a/meta/recipes-devtools/python/python3-native_3.3.3.bb
+++ b/meta/recipes-devtools/python/python3-native_3.3.3.bb
@@ -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
 }