All of lore.kernel.org
 help / color / mirror / Atom feed
* [dylan, master][PATCH] populate_sdk_base: Fix relocate_sdk.py execution on Arch
@ 2013-10-02 23:18 Richard Tollerton
  2013-10-04 11:33 ` Richard Purdie
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Tollerton @ 2013-10-02 23:18 UTC (permalink / raw)
  To: openembedded-core; +Cc: paul.eggleton, gratian.crisan, ken.sharp

relocate_sdk.py is #!/usr/bin/env python, but is not python3-compatible.
The PEP 394 alias `python2` is sadly not universally supported, so
instead of modifying relocate_sdk.py directly, change the `exec` in
relocate_sdk.sh to use it if it exists.

Signed-off-by: Richard Tollerton <rich.tollerton@ni.com>
---
 meta/classes/populate_sdk_base.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass
index e5bc0b4..e67d8b6 100644
--- a/meta/classes/populate_sdk_base.bbclass
+++ b/meta/classes/populate_sdk_base.bbclass
@@ -256,8 +256,9 @@ if [ x$tdir = x ] ; then
    echo "SDK relocate failed, could not create a temporary directory"
    exit 1
 fi
+python_bin="$(command -v python2 2>/dev/null)" || python_bin=python
 echo "#!/bin/bash" > $tdir/relocate_sdk.sh
-echo exec ${env_setup_script%/*}/relocate_sdk.py $target_sdk_dir $dl_path $executable_files >> $tdir/relocate_sdk.sh
+echo exec $python_bin ${env_setup_script%/*}/relocate_sdk.py $target_sdk_dir $dl_path $executable_files >> $tdir/relocate_sdk.sh
 $SUDO_EXEC mv $tdir/relocate_sdk.sh ${env_setup_script%/*}/relocate_sdk.sh
 $SUDO_EXEC chmod 755 ${env_setup_script%/*}/relocate_sdk.sh
 rm -rf $tdir
-- 
1.8.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [dylan, master][PATCH] populate_sdk_base: Fix relocate_sdk.py execution on Arch
  2013-10-02 23:18 [dylan, master][PATCH] populate_sdk_base: Fix relocate_sdk.py execution on Arch Richard Tollerton
@ 2013-10-04 11:33 ` Richard Purdie
  2013-10-04 16:25   ` Rich Tollerton
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Purdie @ 2013-10-04 11:33 UTC (permalink / raw)
  To: Richard Tollerton
  Cc: paul.eggleton, gratian.crisan, ken.sharp, openembedded-core

On Wed, 2013-10-02 at 18:18 -0500, Richard Tollerton wrote:
> relocate_sdk.py is #!/usr/bin/env python, but is not python3-compatible.
> The PEP 394 alias `python2` is sadly not universally supported, so
> instead of modifying relocate_sdk.py directly, change the `exec` in
> relocate_sdk.sh to use it if it exists.
> 
> Signed-off-by: Richard Tollerton <rich.tollerton@ni.com>
> ---
>  meta/classes/populate_sdk_base.bbclass | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Wasn't the script fixed in master to avoid this problem?

Cheers,

Richard

> diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass
> index e5bc0b4..e67d8b6 100644
> --- a/meta/classes/populate_sdk_base.bbclass
> +++ b/meta/classes/populate_sdk_base.bbclass
> @@ -256,8 +256,9 @@ if [ x$tdir = x ] ; then
>     echo "SDK relocate failed, could not create a temporary directory"
>     exit 1
>  fi
> +python_bin="$(command -v python2 2>/dev/null)" || python_bin=python
>  echo "#!/bin/bash" > $tdir/relocate_sdk.sh
> -echo exec ${env_setup_script%/*}/relocate_sdk.py $target_sdk_dir $dl_path $executable_files >> $tdir/relocate_sdk.sh
> +echo exec $python_bin ${env_setup_script%/*}/relocate_sdk.py $target_sdk_dir $dl_path $executable_files >> $tdir/relocate_sdk.sh
>  $SUDO_EXEC mv $tdir/relocate_sdk.sh ${env_setup_script%/*}/relocate_sdk.sh
>  $SUDO_EXEC chmod 755 ${env_setup_script%/*}/relocate_sdk.sh
>  rm -rf $tdir




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dylan, master][PATCH] populate_sdk_base: Fix relocate_sdk.py execution on Arch
  2013-10-04 11:33 ` Richard Purdie
@ 2013-10-04 16:25   ` Rich Tollerton
  0 siblings, 0 replies; 3+ messages in thread
From: Rich Tollerton @ 2013-10-04 16:25 UTC (permalink / raw)
  To: Richard Purdie
  Cc: paul.eggleton, Gratian Crisan, Ken Sharp, openembedded-core

[-- Attachment #1: Type: text/plain, Size: 2156 bytes --]

D'oh! I checked master for changes to .sh generation but not the .py itself. My bad.

Change 175f20e2 (relocate_sdk.py: make it work also with python 3) appears to work fine.

---
Richard Tollerton <rich.tollerton@ni.com> (512)683-6346


-----Richard Purdie <richard.purdie@linuxfoundation.org> wrote: -----
To: Richard Tollerton <rich.tollerton@ni.com>
From: Richard Purdie <richard.purdie@linuxfoundation.org>
Date: 10/04/2013 06:34AM
Cc: openembedded-core@lists.openembedded.org, paul.eggleton@linux.intel.com, gratian.crisan@ni.com, ken.sharp@ni.com
Subject: Re: [OE-core] [dylan, master][PATCH] populate_sdk_base: Fix relocate_sdk.py execution on Arch

On Wed, 2013-10-02 at 18:18 -0500, Richard Tollerton wrote:
> relocate_sdk.py is #!/usr/bin/env python, but is not python3-compatible.
> The PEP 394 alias `python2` is sadly not universally supported, so
> instead of modifying relocate_sdk.py directly, change the `exec` in
> relocate_sdk.sh to use it if it exists.
> 
> Signed-off-by: Richard Tollerton <rich.tollerton@ni.com>
> ---
>  meta/classes/populate_sdk_base.bbclass | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Wasn't the script fixed in master to avoid this problem?

Cheers,

Richard

> diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass
> index e5bc0b4..e67d8b6 100644
> --- a/meta/classes/populate_sdk_base.bbclass
> +++ b/meta/classes/populate_sdk_base.bbclass
> @@ -256,8 +256,9 @@ if [ x$tdir = x ] ; then
>     echo "SDK relocate failed, could not create a temporary directory"
>     exit 1
>  fi
> +python_bin="$(command -v python2 2>/dev/null)" || python_bin=python
>  echo "#!/bin/bash" > $tdir/relocate_sdk.sh
> -echo exec ${env_setup_script%/*}/relocate_sdk.py $target_sdk_dir $dl_path $executable_files >> $tdir/relocate_sdk.sh
> +echo exec $python_bin ${env_setup_script%/*}/relocate_sdk.py $target_sdk_dir $dl_path $executable_files >> $tdir/relocate_sdk.sh
>  $SUDO_EXEC mv $tdir/relocate_sdk.sh ${env_setup_script%/*}/relocate_sdk.sh
>  $SUDO_EXEC chmod 755 ${env_setup_script%/*}/relocate_sdk.sh
>  rm -rf $tdir



[-- Attachment #2: Type: text/html, Size: 2761 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-10-04 16:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-02 23:18 [dylan, master][PATCH] populate_sdk_base: Fix relocate_sdk.py execution on Arch Richard Tollerton
2013-10-04 11:33 ` Richard Purdie
2013-10-04 16:25   ` Rich Tollerton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.