diff mbox

[fsl-community-bsp-base] setup-environment: conditionally show MACHINEs

Message ID 1404919565-11014-1-git-send-email-trevor.woerner@linaro.org
State New
Headers show

Commit Message

Trevor Woerner July 9, 2014, 3:26 p.m. UTC
Before trying to show the supported MACHINEs, make sure they can be found,
otherwise the error message to "ls" will be displayed (which users might find
confusing).

Tested on: bash, dash, zsh.

Signed-off-by: Trevor Woerner <trevor.woerner@linaro.org>
---
 setup-environment | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Daiane Angolini July 11, 2014, 1:37 p.m. UTC | #1
On Wed, Jul 9, 2014 at 12:26 PM, Trevor Woerner
<trevor.woerner@linaro.org> wrote:
> Before trying to show the supported MACHINEs, make sure they can be found,
> otherwise the error message to "ls" will be displayed (which users might find
> confusing).

Good catch!


ACK

Daiane
>
> Tested on: bash, dash, zsh.
>
> Signed-off-by: Trevor Woerner <trevor.woerner@linaro.org>
> ---
>  setup-environment | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/setup-environment b/setup-environment
> index d3f89ce..b8787ba 100755
> --- a/setup-environment
> +++ b/setup-environment
> @@ -47,13 +47,18 @@ usage()
>      <build-dir>: specifies the build directory location (required)
>
>  If undefined, this script will set \$MACHINE to 'imx6qsabresd'.
> +"
>
> +    ls sources/*/conf/machine/*.conf > /dev/null 2>&1
> +    if [ $? -eq 0 ]; then
> +        echo -e "
>  Supported machines: `echo; ls sources/*/conf/machine/*.conf \
>  | sed s/\.conf//g | sed -r 's/^.+\///' | xargs -I% echo -e "\t%"`
>
>  To build for a machine listed above, run this script as:
>  MACHINE=<machine> source $PROGNAME <build-dir>
>  "
> +    fi
>  }
>
>  clean_up()
> --
> 2.0.0.5.gbce14aa
>
> --
> _______________________________________________
> meta-freescale mailing list
> meta-freescale@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/meta-freescale
diff mbox

Patch

diff --git a/setup-environment b/setup-environment
index d3f89ce..b8787ba 100755
--- a/setup-environment
+++ b/setup-environment
@@ -47,13 +47,18 @@  usage()
     <build-dir>: specifies the build directory location (required)
 
 If undefined, this script will set \$MACHINE to 'imx6qsabresd'.
+"
 
+    ls sources/*/conf/machine/*.conf > /dev/null 2>&1
+    if [ $? -eq 0 ]; then
+        echo -e "
 Supported machines: `echo; ls sources/*/conf/machine/*.conf \
 | sed s/\.conf//g | sed -r 's/^.+\///' | xargs -I% echo -e "\t%"`
 
 To build for a machine listed above, run this script as:
 MACHINE=<machine> source $PROGNAME <build-dir>
 "
+    fi
 }
 
 clean_up()