diff options
author | Ryan S. Arnold <ryan.arnold@linaro.org> | 2015-03-19 09:40:34 -0500 |
---|---|---|
committer | Ryan S. Arnold <ryan.arnold@linaro.org> | 2015-03-19 09:40:34 -0500 |
commit | bc788768c518f6b5985a6d62178e18f47867056d (patch) | |
tree | 98298f97ae531ce4f2254e9277ac2366f27ad064 /abe.sh | |
parent | fd790f9d509e51b6a52b1786bed4d7bfcdcec068 (diff) |
abe.sh: Error out on unknown --<foo> directives, invalid <foo>= components, and unknown commands.
[Linaro BZ 1372] https://bugs.linaro.org/show_bug.cgi?id=1372
This patch and accompanying abe/test.sh changes cause build failure
when processing abe input commands under the following conditions:
* Unsupported --<foo> directives will cause build failure.
* Invalid <foo>= components will cause build failure.
* Unknown commands <foo> (not directives or component specifiers) will
cause build faiure.
This solves the problem with --libc=<bar> being ignored and execution
of abe progressing.
Change-Id: Iad819f57e5f6ab575c68b6a63cfeb07a8bea3adf
Diffstat (limited to 'abe.sh')
-rwxr-xr-x | abe.sh | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -1046,6 +1046,13 @@ while test $# -gt 0; do exit 0 ;; *) + # Look for unsupported -<foo> or --<foo> directives. + if test `echo $1 | grep -Ec "^-+"` -gt 0; then + error "${1}: Directive not supported. See ${abe} --help for supported options." + build_failure + fi + + # Test for <foo>= specifiers if test `echo $1 | grep -c =` -gt 0; then name="`echo $1 | cut -d '=' -f 1`" value="`echo $1 | cut -d '=' -f 2`" @@ -1100,14 +1107,21 @@ while test $# -gt 0; do newlib_version="${value}" ;; *) + error "FIXME: Execution should never reach this point." + build_failure ;; esac ;; *) + # This will catch unsupported component specifiers like <foo>= + error "${name}: Component specified not supported. See ${abe} --help for supported components." + build_failure ;; esac else - error "$1: Command not recognized." + # This will catch dangling words like <foo> that don't contain + # --<foo> and don't contain <foo>= + error "$1: Command not recognized. See ${abe} --help for supported options." build_failure fi ;; |