Idwer Vollering has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/49307 )
Change subject: util/board_status/board_status.sh: improve getopt detection and usage on non-linux OSes ......................................................................
util/board_status/board_status.sh: improve getopt detection and usage on non-linux OSes
Signed-off-by: Idwer Vollering vidwer@gmail.com Change-Id: Iba50d8a8609eda974f12b0d9802e04d7371aed5b --- M util/board_status/board_status.sh 1 file changed, 14 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/07/49307/1
diff --git a/util/board_status/board_status.sh b/util/board_status/board_status.sh index ab4a310..17ba85c 100755 --- a/util/board_status/board_status.sh +++ b/util/board_status/board_status.sh @@ -205,7 +205,19 @@ " }
-getopt -T +case $(uname) in +FreeBSD) + if [ ! -x /usr/local/bin/getopt ]; then + echo 'Please install getopt, or build and install misc/getopt from ports' + exit $EXIT_FAILURE + else + GETOPT=/usr/local/bin/getopt;; + fi +*) + GETOPT=/usr/bin/getopt;; +esac + +$GETOPT -T if [ $? -ne 4 ]; then echo "GNU-compatible getopt(1) required." exit $EXIT_FAILURE @@ -215,7 +227,7 @@ LONGOPTS="${LONGOPTS},serial-device:,serial-speed:" LONGOPTS="${LONGOPTS},ssh-port:"
-ARGS=$(getopt -o c:n:Chi:r:s:S:u -l "$LONGOPTS" -n "$0" -- "$@"); +ARGS=$($GETOPT -o c:n:Chi:r:s:S:u -l "$LONGOPTS" -n "$0" -- "$@"); if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi eval set -- "$ARGS" while true ; do