ACCUMULO-2956 Make bootstrap_config work on Mac

  Based on patch submitted to ACCUMULO-2646 by [~bhavanki]


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/5d81eca4
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/5d81eca4
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/5d81eca4

Branch: refs/heads/master
Commit: 5d81eca4d8ca25843eb2f6c201809e437133e823
Parents: be62a67
Author: Christopher Tubbs <ctubb...@apache.org>
Authored: Fri Jun 27 12:42:46 2014 -0400
Committer: Christopher Tubbs <ctubb...@apache.org>
Committed: Fri Jun 27 12:42:46 2014 -0400

----------------------------------------------------------------------
 assemble/bin/bootstrap_config.sh | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/5d81eca4/assemble/bin/bootstrap_config.sh
----------------------------------------------------------------------
diff --git a/assemble/bin/bootstrap_config.sh b/assemble/bin/bootstrap_config.sh
index 5d36499..fb643da 100755
--- a/assemble/bin/bootstrap_config.sh
+++ b/assemble/bin/bootstrap_config.sh
@@ -18,14 +18,14 @@
 function usage {
   cat <<EOF
 Usage: bootstrap_config.sh [-options]
-where options include:
-    -d --dir        Alternate directory to setup config files
-    -s --size       Supported sizes: '1GB' '2GB' '3GB' '512MB'
-    -n --native     Configure to use native libraries
-    -j --jvm        Configure to use the jvm
-    -o --overwrite  Overwrite the default config directory
-    -v --version    Specify the Apache Hadoop version supported versions: '1' 
'2'
-    -h --help       Print this help message
+where options include (long options not available on all platforms):
+    -d, --dir        Alternate directory to setup config files
+    -s, --size       Supported sizes: '1GB' '2GB' '3GB' '512MB'
+    -n, --native     Configure to use native libraries
+    -j, --jvm        Configure to use the jvm
+    -o, --overwrite  Overwrite the default config directory
+    -v, --version    Specify the Apache Hadoop version supported versions: '1' 
'2'
+    -h, --help       Print this help message
 EOF
 }
 
@@ -56,7 +56,11 @@ OVERWRITE="0"
 BASE_DIR=
 
 #Execute getopt
-args=$(getopt -o "b:d:s:njov:h" -l 
"basedir:,dir:,size:,native,jvm,overwrite,version:,help" -q -- "$@")
+if [[ $(uname -s) == "Linux" ]]; then
+  args=$(getopt -o "b:d:s:njov:h" -l 
"basedir:,dir:,size:,native,jvm,overwrite,version:,help" -q -- "$@")
+else # Darwin, BSD
+  args=$(getopt b:d:s:njov:h $*)
+fi
 
 #Bad arguments
 if [[ $? != 0 ]]; then

Reply via email to