From 877d856ef9db6324a9c8501cbc43c93be78aebe3 Mon Sep 17 00:00:00 2001 From: Willem Jan Withagen Date: Sat, 31 Mar 2018 02:01:01 +0200 Subject: [PATCH] tools: FreeBSD basic getopt does not use --options Signed-off-by: Willem Jan Withagen --- src/tools/setup-virtualenv.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/tools/setup-virtualenv.sh b/src/tools/setup-virtualenv.sh index 336f4fca498..9ef0b74cf15 100755 --- a/src/tools/setup-virtualenv.sh +++ b/src/tools/setup-virtualenv.sh @@ -17,6 +17,11 @@ SCRIPTNAME="$(basename $0)" PYTHON_BINARY="python2.7" +if [ `uname` == FreeBSD ]; then + GETOPT="/usr/local/bin/getopt" +else + GETOPT=getopt +fi function usage { echo @@ -33,7 +38,7 @@ function usage { exit 1 } -TEMP=$(getopt --options "h" --long "help,python:" --name "$SCRIPTNAME" -- "$@") +TEMP=$($GETOPT --options "h" --long "help,python:" --name "$SCRIPTNAME" -- "$@") test $? != 0 && usage eval set -- "$TEMP" -- 2.39.5