diff options
author | Stefan Reinauer <stefan.reinauer@coreboot.org> | 2024-02-08 21:44:15 -0800 |
---|---|---|
committer | Felix Singer <service+coreboot-gerrit@felixsinger.de> | 2024-03-02 03:55:01 +0000 |
commit | 98ecb1612cb5d117529e6c7903363333eee89b3b (patch) | |
tree | b20a14c8bc19ccefdf529d4babcaee27fe61b2c6 /util/lint | |
parent | 343ef6fc3f5f4ae9df499df23f151a16a59b1ef1 (diff) |
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>
Diffstat (limited to 'util/lint')
-rwxr-xr-x | util/lint/lint | 9 |
1 files changed, 8 insertions, 1 deletions
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 |