Re: [OE-core] [PATCH] toolchain-shar-extract.sh: Ensure it's ran in clean environment

2015-11-26 Thread Paul Eggleton
On Wednesday 25 November 2015 16:28:45 George Nita wrote:
> Fixes [YOCTO #8698] --
> https://bugzilla.yoctoproject.org/show_bug.cgi?id=8698
> 
> If prior to running the toolchain installation script a toolchain
> environment script is sourced then the toolchain installation will
> fail. This because the environment is now set for the sourced toolchain
> and doesn't suit the installation. In particular PATH points to the
> toolchain executables.
> 
> The fix makes the script recursively call itself a second time with a
> clean environment.
> 
> Tested by sourcing a previous successfully installed environment, erasing
> the previous installation directory and then reinstalling in the same
> directory.
> 
> Signed-off-by: George Nita 
> ---
>  meta/files/toolchain-shar-extract.sh | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/meta/files/toolchain-shar-extract.sh
> b/meta/files/toolchain-shar-extract.sh index 98b9f1c..4fd734a 100644
> --- a/meta/files/toolchain-shar-extract.sh
> +++ b/meta/files/toolchain-shar-extract.sh
> @@ -1,5 +1,7 @@
>  #!/bin/sh
> 
> +[ -z "$ENVCLEANED" ] && exec /usr/bin/env -i ENVCLEANED=1 "$0" "$@"
> +
>  INST_ARCH=$(uname -m | sed -e "s/i[3-6]86/ix86/" -e "s/x86[-_]64/x86_64/")
>  SDK_ARCH=$(echo @SDK_ARCH@ | sed -e "s/i[3-6]86/ix86/" -e
> "s/x86[-_]64/x86_64/")

Acked-by: Paul Eggleton 

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] toolchain-shar-extract.sh: Ensure it's ran in clean environment

2015-11-25 Thread George Nita
Fixes [YOCTO #8698] -- https://bugzilla.yoctoproject.org/show_bug.cgi?id=8698

If prior to running the toolchain installation script a toolchain
environment script is sourced then the toolchain installation will
fail. This because the environment is now set for the sourced toolchain
and doesn't suit the installation. In particular PATH points to the
toolchain executables.

The fix makes the script recursively call itself a second time with a
clean environment.

Tested by sourcing a previous successfully installed environment, erasing the
previous installation directory and then reinstalling in the same directory.

Signed-off-by: George Nita 
---
 meta/files/toolchain-shar-extract.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/files/toolchain-shar-extract.sh 
b/meta/files/toolchain-shar-extract.sh
index 98b9f1c..4fd734a 100644
--- a/meta/files/toolchain-shar-extract.sh
+++ b/meta/files/toolchain-shar-extract.sh
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+[ -z "$ENVCLEANED" ] && exec /usr/bin/env -i ENVCLEANED=1 "$0" "$@"
+
 INST_ARCH=$(uname -m | sed -e "s/i[3-6]86/ix86/" -e "s/x86[-_]64/x86_64/")
 SDK_ARCH=$(echo @SDK_ARCH@ | sed -e "s/i[3-6]86/ix86/" -e 
"s/x86[-_]64/x86_64/")
 
-- 
1.9.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core