Skip to content
This repository was archived by the owner on Nov 16, 2020. It is now read-only.

Commit 8b695b9

Browse files
committed
Update rabbitmq-components.mk
1 parent d51e717 commit 8b695b9

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

rabbitmq-components.mk

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ dep_cowlib = hex 2.7.0
116116
dep_jsx = hex 2.11.0
117117
dep_lager = hex 3.8.0
118118
dep_prometheus = hex 4.6.0
119-
dep_ra = hex 1.1.5
119+
dep_ra = hex 1.1.6
120120
dep_ranch = hex 1.7.1
121121
dep_recon = hex 2.5.1
122122
dep_observer_cli = hex 1.5.4
@@ -316,21 +316,28 @@ prepare-dist::
316316
# Umbrella-specific settings.
317317
# --------------------------------------------------------------------
318318

319-
# If this project is under the Umbrella project, we override $(DEPS_DIR)
320-
# to point to the Umbrella's one. We also disable `make distclean` so
321-
# $(DEPS_DIR) is not accidentally removed.
319+
# If the top-level project is a RabbitMQ component, we override
320+
# $(DEPS_DIR) for this project to point to the top-level's one. We also
321+
# disable `make distclean` so $(DEPS_DIR) is not accidentally removed.
322322

323-
ifneq ($(wildcard ../../UMBRELLA.md),)
324-
UNDER_UMBRELLA = 1
325-
DEPS_DIR ?= $(abspath ..)
326-
else ifneq ($(wildcard ../../../../UMBRELLA.md),)
327-
UNDER_UMBRELLA = 1
328-
DEPS_DIR ?= $(abspath ../../..)
323+
ifneq ($(wildcard ../../rabbitmq-components.mk),)
324+
supposed_deps_dir = $(abspath ..)
325+
else ifneq ($(wildcard ../../../../rabbitmq-components.mk),)
326+
supposed_deps_dir = $(abspath ../../..)
329327
else ifneq ($(wildcard UMBRELLA.md),)
330-
UNDER_UMBRELLA = 1
328+
DISABLE_DISTCLEAN = 1
331329
endif
332330

333-
ifeq ($(UNDER_UMBRELLA),1)
331+
# We also verify that the guessed DEPS_DIR is actually named `deps`, to rule
332+
# out any situation where it is a coincidence that we found a
333+
# `rabbitmq-components.mk` up upper directories.
334+
335+
ifeq ($(notdir $(supposed_deps_dir)),deps)
336+
DISABLE_DISTCLEAN = 1
337+
DEPS_DIR ?= $(supposed_deps_dir)
338+
endif
339+
340+
ifeq ($(DISABLE_DISTCLEAN),1)
334341
ifneq ($(filter distclean distclean-deps,$(MAKECMDGOALS)),)
335342
SKIP_DEPS = 1
336343
endif

0 commit comments

Comments
 (0)