From 5d8a76da9b2fd581367ec015dc9ce84c85f4efea Mon Sep 17 00:00:00 2001 From: Etheryte Date: Thu, 3 Aug 2023 14:17:14 +0300 Subject: [PATCH] Add BSD getopt error for macOS --- rel-eng/bin/mkchlog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rel-eng/bin/mkchlog b/rel-eng/bin/mkchlog index d7109fc955ad..9e9d8d233d4d 100755 --- a/rel-eng/bin/mkchlog +++ b/rel-eng/bin/mkchlog @@ -27,6 +27,12 @@ Uyuni project: EOF } +# Out of the box macOS ships with BSD getopt which doesn't support long args +if [ "$(uname -s)" == "Darwin" ] && $(man getopt | grep -i -q "bsd"); then + echo "Error: This tool requires GNU getopt, but your system is using BSD getopt. Please install GNU getopt and add it to your PATH." + exit 1 +fi + ARGS=$(getopt -n mkchlog -o rhnf:u: --long remove,help,no-wrap,feature:username: -- "$@") if [ $? -ne 0 ]; then exit 1