]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tools/ceph-monstore-update-crush.sh: FreeBSD getopt is not compatible, use the one... 11525/head
authorWillem Jan Withagen <wjw@digiware.nl>
Tue, 18 Oct 2016 09:33:09 +0000 (11:33 +0200)
committerWillem Jan Withagen <wjw@digiware.nl>
Tue, 18 Oct 2016 09:40:28 +0000 (11:40 +0200)
Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
install-deps.sh
src/tools/ceph-monstore-update-crush.sh

index 96d66219e06575d52412f6b0686dd70ed5043c30..a8ebda8f8e67a5bb2b286f594260a4defb1fc6b7 100755 (executable)
@@ -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 \
index 1508f06ddaf0310851b970f61a79884518f17ed7..73c6dd0bccf0cd08977ce3ff4f413b649aaf9107 100755 (executable)
@@ -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
@@ -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