[coreboot-gerrit] New patch to review for coreboot: buildgcc: Check exit status of `getopt`

Nico Huber (nico.h@gmx.de) gerrit at coreboot.org
Tue Sep 20 14:19:42 CEST 2016


Nico Huber (nico.h at gmx.de) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16680

-gerrit

commit 1172362e03debf37f633dc7c9c949b80dd4dfb68
Author: Nico Huber <nico.huber at secunet.com>
Date:   Tue Sep 20 14:11:53 2016 +0200

    buildgcc: Check exit status of `getopt`
    
    We accidentally checked the status of `eval` instead.
    
    Change-Id: I1ba258944184ed707ed1f176e528d8266656cb59
    Signed-off-by: Nico Huber <nico.huber at secunet.com>
---
 util/crossgcc/buildgcc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc
index 81632df..618aff3 100755
--- a/util/crossgcc/buildgcc
+++ b/util/crossgcc/buildgcc
@@ -691,14 +691,16 @@ getoptbrand="$(getopt -V | sed -e '1!d' -e 's,^\(......\).*,\1,')"
 if [ "${getoptbrand}" = "getopt" ]; then
 	# Detected GNU getopt that supports long options.
 	args=$(getopt -l version,help,clean,directory:,bootstrap,platform:,languages:,package:,jobs:,destdir:,savetemps,scripting,ccache,supported: -o Vhcd:bp:l:P:j:D:tSys: -- "$@")
+	getopt_ret=$?
 	eval set -- "$args"
 else
 	# Detected non-GNU getopt
 	args=$(getopt Vhcd:bp:l:P:j:D:tSys: $*)
+	getopt_ret=$?
 	set -- $args
 fi
 
-if [ $? != 0 ]; then
+if [ $getopt_ret != 0 ]; then
 	myhelp
 	exit 1
 fi



More information about the coreboot-gerrit mailing list