aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKousuke Saruta <sarutak@oss.nttdata.co.jp>2014-10-24 13:04:35 -0700
committerAndrew Or <andrew@databricks.com>2014-10-24 13:05:47 -0700
commit386fc46bc039714fdfcf3db679f689287f8ef836 (patch)
tree9d532731a3bba8a7993891be99a8408a4821c546
parent926f8ca5370e506eee92cc82eb2153fe7c80a504 (diff)
downloadspark-386fc46bc039714fdfcf3db679f689287f8ef836.tar.gz
spark-386fc46bc039714fdfcf3db679f689287f8ef836.tar.bz2
spark-386fc46bc039714fdfcf3db679f689287f8ef836.zip
[SPARK-4076] Parameter expansion in spark-config is wrong
In sbin/spark-config.sh, parameter expansion is used to extract source root as follows. this="${BASH_SOURCE-$0}" I think, the parameter expansion should be ":" instead of "". If we use "-" and BASH_SOURCE="", (empty character is set, not unset), "" (empty character) is set to $this. Author: Kousuke Saruta <sarutak@oss.nttdata.co.jp> Closes #2930 from sarutak/SPARK-4076 and squashes the following commits: 32a0370 [Kousuke Saruta] Fixed wrong parameter expansion (cherry picked from commit 30ea2868e7afbec20bfc83818249b6d2d7dc6aec) Signed-off-by: Andrew Or <andrew@databricks.com> Conflicts: sbin/spark-config.sh
-rwxr-xr-xsbin/spark-config.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/spark-config.sh b/sbin/spark-config.sh
index 396c729511..62f9b30bd9 100755
--- a/sbin/spark-config.sh
+++ b/sbin/spark-config.sh
@@ -20,8 +20,8 @@
# also should not be passed any arguments, since we need original $*
# resolve links - $0 may be a softlink
-this="${BASH_SOURCE-$0}"
-common_bin=$(cd -P -- "$(dirname -- "$this")" && pwd -P)
+this="${BASH_SOURCE:-$0}"
+common_bin="$(cd -P -- "$(dirname -- "$this")" && pwd -P)"
script="$(basename -- "$this")"
this="$common_bin/$script"