Skip to content

Commit

Permalink
tools/ceph-monstore-update-crush.sh: FreeBSD getopt is not compatible…
Browse files Browse the repository at this point in the history
…, use the one from packages

Signed-off-by: Willem Jan Withagen <[email protected]>
  • Loading branch information
wjwithagen committed Oct 18, 2016
1 parent 2eb89c8 commit 3c8cd0f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions install-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ if [ x`uname`x = xFreeBSDx ]; then
archivers/snappy \
ftp/curl \
misc/e2fsprogs-libuuid \
misc/getopt \
textproc/expat2 \
textproc/libxml2 \
textproc/xmlstarlet \
Expand Down
8 changes: 7 additions & 1 deletion src/tools/ceph-monstore-update-crush.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ else
exit 1
fi

if [ `uname` = FreeBSD ]; then
GETOPT=/usr/local/bin/getopt
else
GETOPT=getopt
fi

function osdmap_get() {
local store_path=$1
local query=$2
Expand Down Expand Up @@ -90,7 +96,7 @@ EOF

function main() {
local temp
temp=$(getopt -o h --long verbose,help,mon-store:,out:,rewrite -n $0 -- "$@") || return 1
temp=$($GETOPT -o h --long verbose,help,mon-store:,out:,rewrite -n $0 -- "$@") || return 1

eval set -- "$temp"
local rewrite
Expand Down

0 comments on commit 3c8cd0f

Please sign in to comment.