summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Sébastien Pédron <jean-sebastien.pedron@dumbbell.fr>2015-10-20 15:42:59 +0200
committerJean-Sébastien Pédron <jean-sebastien.pedron@dumbbell.fr>2015-10-20 15:42:59 +0200
commit7a9c6b771e077165e449d1fc5ae1d03e24ee49d7 (patch)
treec8ae798eb8bc7d09d7e0bd4854a40cee4150047b
parent39d53d797cd3c50464654ddeea839b0cbfb7ea3d (diff)
downloadrabbitmq-server-git-7a9c6b771e077165e449d1fc5ae1d03e24ee49d7.tar.gz
rabbitmqctl-env: Fix how we locate rabbit_common
-rw-r--r--scripts/rabbitmq-env30
1 files changed, 19 insertions, 11 deletions
diff --git a/scripts/rabbitmq-env b/scripts/rabbitmq-env
index 156c05dbc5..cc05015cef 100644
--- a/scripts/rabbitmq-env
+++ b/scripts/rabbitmq-env
@@ -255,19 +255,27 @@ if [ "${RABBITMQ_DEV_ENV}" ]; then
fi
fi
- # When RabbitMQ or the rabbitmq* scripts are started from the source
- # directory, they need the location of rabbit_common.
-
- DEPS_DIR_norm="${DEPS_DIR}"
- rmq_normalize_path_var DEPS_DIR_norm
-
if [ -d "${RABBITMQ_PLUGINS_DIR}" ]; then
- # RabbitMQ was started with "make run-broker". Take
- # rabbit_common from the plugins directory.
+ # 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}"
- elif [ "${DEPS_DIR_norm}" -a -d "${DEPS_DIR_norm}/rabbit_common/ebin" ]; then
- # RabbitMQ runs from a testsuite. The .ez files are not created
- # in this case, take DEPS_DIR directly.
+ else
+ # RabbitMQ runs from a testsuite or a plugin. The .ez files are
+ # not available under RabbitMQ source tree. We need to look at
+ # $DEPS_DIR and default locations.
+
+ if [ "${DEPS_DIR}" -a -d "${DEPS_DIR}/rabbit_common/ebin" ]; then
+ # $DEPS_DIR is set, and it contains rabbitmq-common, use
+ # this.
+ DEPS_DIR_norm="${DEPS_DIR}"
+ elif [ -f "${RABBITMQ_SCRIPTS_DIR}/../../../erlang.mk" -a \
+ -d "${RABBITMQ_SCRIPTS_DIR}/../../rabbit_common/ebin" ]; then
+ # Look at default locations: "deps" subdirectory inside a
+ # plugin or the Umbrella.
+ DEPS_DIR_norm="${RABBITMQ_SCRIPTS_DIR}/../.."
+ fi
+ DEPS_DIR_norm=$(rmq_realpath "${DEPS_DIR_norm}")
+
ERL_LIBS="${DEPS_DIR_norm}:${ERL_LIBS}"
fi
else