diff options
| author | Gerhard Lazu <gerhard@rabbitmq.com> | 2016-11-30 17:37:05 +0000 |
|---|---|---|
| committer | Gerhard Lazu <gerhard@rabbitmq.com> | 2016-11-30 17:39:42 +0000 |
| commit | 3b7c05c8db27f19e993e5fc230954e3707af46bd (patch) | |
| tree | 31e4242eb6be78cda0fb97c1ce34df8d3c28d981 /scripts/rabbitmq-env | |
| parent | 4ca5396b5d77b39a6de518c7ae580d1591ae2b84 (diff) | |
| parent | c2160877085bf4755cac3a2338695597c136523f (diff) | |
| download | rabbitmq-server-git-3b7c05c8db27f19e993e5fc230954e3707af46bd.tar.gz | |
Merge branch 'stable' into rabbitmq-server-1033
Conflicts:
rabbitmq-components.mk
Diffstat (limited to 'scripts/rabbitmq-env')
| -rwxr-xr-x | scripts/rabbitmq-env | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/scripts/rabbitmq-env b/scripts/rabbitmq-env index 8c33e7c0b7..3055552d88 100755 --- a/scripts/rabbitmq-env +++ b/scripts/rabbitmq-env @@ -57,6 +57,20 @@ rmq_realpath() { fi } +path_contains_existing_directory() { + local path="${1:?}" + local dir + local rc + local IFS=" + " + for dir in $(echo "$path" | tr ':' '\n'); do + if [ -d "$dir" ]; then + return 0 + fi + done + return 1 +} + RABBITMQ_HOME="$(rmq_realpath "${RABBITMQ_SCRIPTS_DIR}/..")" ## Set defaults @@ -107,8 +121,9 @@ fi rmq_normalize_path() { local path=$1 - # Remove redundant slashes and strip a trailing slash - echo "$path" | sed -e 's#/\{2,\}#/#g' -e 's#/$##' + # Remove redundant slashes and strip a trailing slash for a + # PATH-like vars - ':' is the delimiter + echo "$path" | sed -e 's#/\{2,\}#/#g' -e 's#/$##' -e 's#/:#:#g' } rmq_normalize_path_var() { @@ -266,7 +281,7 @@ if [ "${RABBITMQ_DEV_ENV}" ]; then fi fi - if [ -d "${RABBITMQ_PLUGINS_DIR}" ]; then + if path_contains_existing_directory "${RABBITMQ_PLUGINS_DIR}" ; then # RabbitMQ was started with "make run-broker" from its own # source tree. Take rabbit_common from the plugins directory. ERL_LIBS="${RABBITMQ_PLUGINS_DIR}:${ERL_LIBS}" @@ -290,7 +305,7 @@ if [ "${RABBITMQ_DEV_ENV}" ]; then ERL_LIBS="${DEPS_DIR_norm}:${ERL_LIBS}" fi else - if [ -d "${RABBITMQ_PLUGINS_DIR}" ]; then + if path_contains_existing_directory "${RABBITMQ_PLUGINS_DIR}" ; then # RabbitMQ was started from its install directory. Take # rabbit_common from the plugins directory. ERL_LIBS="${RABBITMQ_PLUGINS_DIR}:${ERL_LIBS}" |
