basho / riak

Riak is a decentralized datastore from Basho Technologies.
http://docs.basho.com
Apache License 2.0
3.95k stars 537 forks source link

riak-debug is broken in Solaris #546

Closed runesl closed 10 years ago

runesl commented 10 years ago

bin/riak-debug_: syntax error at line 179:(' unexpected`

Fix: Line 1: Change #!/bin/sh to #!/bin/bash Line 592+594: Remove z parameter from tar command.

slfritchie commented 10 years ago

Hi, Rune. I understand the 2nd fix but not the first. We try very hard to avoid Bash'isms in our shell script code and to use only Bourne shell-compatible syntax, so I do not understand the reason behind suggesting Bash.

runesl commented 10 years ago

I get this error when running with sh instead of bash: ./riak-debug: syntax error at line 179: `(' unexpected

This seems to be the offending line: if [ 0 -eq $(( $get_cfgs + $get_logs + $get_riakcmds + $get_syscmds + $get_extracmds )) ]; then

I'm no shell script guru, so I'll leave the fix to you.

jaredmorrow commented 10 years ago

We will not change any of our scripts to /bin/bash that we ship with the product because that adds an unnecessary dependency on installing bash on those platforms that do not ship with it by default. These include Solaris, FreeBSD, OpenBSD, and SmartOS.

We will fix the issue with the actual line as there should be no bashisms in the script.

jaredmorrow commented 10 years ago

The following is the issue I get on riak-debug:

$ checkbashisms riak-debug   
possible bashism in riak-debug line 115 (<<< here string):
read riak_app_config riak_vm_args <<< `"$riak_bin_dir"/riak config generate | cut -d' ' -f 3,5`

This use of read as a separator should be replaced with two calls to cut -d' ' so continue to work on in sh