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 <stefan.reinauer@coreboot.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/80436
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Stefan Reinauer
2024-02-08 21:44:15 -08:00
committed by Felix Singer
parent 343ef6fc3f
commit 98ecb1612c

View File

@@ -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