ACCUMULO-4162 Fix zookeeper version matching

This makes zookeeper version match more tolerant of trailing slashes on
the ZOOKEEPER_HOME variable, and overall simplifies the matching.


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

Branch: refs/heads/1.7
Commit: b040557aae17d5f84d9bc1d3ae40be817a69c657
Parents: ecfd95c
Author: Christopher Tubbs <ctubb...@apache.org>
Authored: Thu Mar 24 18:33:51 2016 -0400
Committer: Christopher Tubbs <ctubb...@apache.org>
Committed: Thu Mar 24 18:33:51 2016 -0400

----------------------------------------------------------------------
 assemble/bin/start-all.sh | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/b040557a/assemble/bin/start-all.sh
----------------------------------------------------------------------
diff --git a/assemble/bin/start-all.sh b/assemble/bin/start-all.sh
index b71ba70..445e046 100755
--- a/assemble/bin/start-all.sh
+++ b/assemble/bin/start-all.sh
@@ -50,10 +50,9 @@ if [ -z "$ZOOKEEPER_VERSION" ]; then
    echo "Please check ZOOKEEPER_HOME, either globally or in accumulo-env.sh."
    exit 1
 fi
-ZOOKEEPER_VERSION=${ZOOKEEPER_VERSION##$ZOOKEEPER_HOME/zookeeper-}
-ZOOKEEPER_VERSION=${ZOOKEEPER_VERSION%%.jar}
+ZOOKEEPER_VERSION=$(basename "${ZOOKEEPER_VERSION##*-}" .jar)
 
-if [ "$ZOOKEEPER_VERSION" '<' "3.3.0" ]; then
+if [[ "$ZOOKEEPER_VERSION" < "3.3.0" ]]; then
    echo "WARN : Using Zookeeper $ZOOKEEPER_VERSION.  Use version 3.3.0 or 
greater to avoid zookeeper deadlock bug.";
 fi
 

Reply via email to