From 98ecb1612cb5d117529e6c7903363333eee89b3b Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Thu, 8 Feb 2024 21:44:15 -0800 Subject: lint: Make lint work on Darwin Darwin's getopt does not support the same parameters as the util-linux version and so it is not possible to commit any changes because lint fails. Change-Id: Ife26083d2de080af9ed3d509945720051ca14bd7 Signed-off-by: Stefan Reinauer Reviewed-on: https://review.coreboot.org/c/coreboot/+/80436 Reviewed-by: Felix Singer Tested-by: build bot (Jenkins) --- util/lint/lint | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/util/lint/lint b/util/lint/lint index 94cd4a6253..1896db1c48 100755 --- a/util/lint/lint +++ b/util/lint/lint @@ -29,7 +29,14 @@ junit_write () { fi } -if ! cmd_args="$(getopt -l help,junit,invert -o hIJ -- "$@")"; then +# Look if we have getopt. If not, build it. +if [ $(uname) == Darwin ]; then + GETOPT="getopt hIJ" +else + GETOPT="getopt -l help,junit,invert -o hIJ" +fi + +if ! cmd_args="$($GETOPT -- "$@")"; then usage exit 0 fi -- cgit v1.2.3