From: Willem Jan Withagen Date: Sat, 31 Mar 2018 00:01:01 +0000 (+0200) Subject: tools: FreeBSD basic getopt does not use --options X-Git-Tag: v13.1.0~402^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F21148%2Fhead;p=ceph.git tools: FreeBSD basic getopt does not use --options Signed-off-by: Willem Jan Withagen --- 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"