You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2020/09/28 19:08:38 UTC

[GitHub] [accumulo] ctubbsii commented on a change in pull request #1716: Update tool.sh to set correct ZOOKEEPER_CMD.

ctubbsii commented on a change in pull request #1716:
URL: https://github.com/apache/accumulo/pull/1716#discussion_r496168951



##########
File path: assemble/bin/tool.sh
##########
@@ -36,7 +36,10 @@ if [[ -z "$ZOOKEEPER_HOME" ]] ; then
    exit 1
 fi
 
-ZOOKEEPER_CMD='ls -1 $ZOOKEEPER_HOME/zookeeper-[0-9]*[^csn].jar '
+ZOOKEEPER_CMD='ls -1 $ZOOKEEPER_HOME/lib/zookeeper-[0-9]*[^csn].jar '
+if [[ "${ZOOKEEPER_VERSION}" = 3.[01234].* ]]; then

Review comment:
       I find the regex pattern matching feature of bash to be more reliable than the glob equality feature. Also, the quotes and braces on the left side aren't neeeded.
   
   However, a more fundamental problem: where is `ZOOKEEPER_VERSION` defined? There is no guarantee it is defined anywhere by anything that calls this script. It should probably do something like what `assemble/bin/start-all.sh` does.
   
   ```suggestion
   ZOOKEEPER_VERSION=$(find -L "$ZOOKEEPER_HOME" -maxdepth 2 -name "zookeeper-[0-9]*.jar" | head -1)
   if [[ $ZOOKEEPER_VERSION =~ ^3[.][01234].*$ ]]; then
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org