Issue 1343: get_config called from gerrit.sh might return a leading space
Status:  New
Owner: ----
Reported by jason.ca...@gmail.com, Apr 20, 2012
Affected Version: 2.2.0

What steps will reproduce the problem?
Run gerrit.sh on Ubuntu.

What is the expected output? What do you see instead?
gerrit.sh asks user to define JAVA_HOME, which it shouldn't, since java is definitely installed.

Please provide any additional information below.
Get_config can return a string with a leading space.  In this case, the command "JAVA_HOME= /path/to/java" executes, which leaves JAVA_HOME empty.  I solved this with a pipe to sed to remove the leading space.

Here's my entire test instrumentation to isolate and solve the problem:

$ diff gerrit_site/bin/gerrit.sh.orig gerrit_site/bin/gerrit.sh
220a221
> set -x
222c223
< JAVA_HOME=`get_config --get container.javaHome`
---
> JAVA_HOME=`get_config --get container.javaHome | sed 's,^ ,,'`
283a285,286
> exit
>