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

Trevor Woerner trevor.woerner at linaro.org
Wed Jul 9 08:26:05 PDT 2014


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



More information about the meta-freescale mailing list