buildgcc: Check exit status of `getopt`
We accidentally checked the status of `eval` instead. Change-Id: I1ba258944184ed707ed1f176e528d8266656cb59 Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: https://review.coreboot.org/16680 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
parent
cc414dd47f
commit
78df0bf46d
|
@ -691,14 +691,16 @@ getoptbrand="$(getopt -V | sed -e '1!d' -e 's,^\(......\).*,\1,')"
|
||||||
if [ "${getoptbrand}" = "getopt" ]; then
|
if [ "${getoptbrand}" = "getopt" ]; then
|
||||||
# Detected GNU getopt that supports long options.
|
# Detected GNU getopt that supports long options.
|
||||||
args=$(getopt -l version,help,clean,directory:,bootstrap,platform:,languages:,package:,jobs:,destdir:,savetemps,scripting,ccache,supported:,urls,nocolor -o Vhcd:bp:l:P:j:D:tSys:un -- "$@")
|
args=$(getopt -l version,help,clean,directory:,bootstrap,platform:,languages:,package:,jobs:,destdir:,savetemps,scripting,ccache,supported:,urls,nocolor -o Vhcd:bp:l:P:j:D:tSys:un -- "$@")
|
||||||
|
getopt_ret=$?
|
||||||
eval set -- "$args"
|
eval set -- "$args"
|
||||||
else
|
else
|
||||||
# Detected non-GNU getopt
|
# Detected non-GNU getopt
|
||||||
args=$(getopt Vhcd:bp:l:P:j:D:tSys:un $*)
|
args=$(getopt Vhcd:bp:l:P:j:D:tSys:un $*)
|
||||||
|
getopt_ret=$?
|
||||||
set -- $args
|
set -- $args
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $? != 0 ]; then
|
if [ $getopt_ret != 0 ]; then
|
||||||
myhelp
|
myhelp
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue