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

Commit ebafcc2

Browse files
committed
Update rabbitmq-components.mk
1 parent 17fb74c commit ebafcc2

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

rabbitmq-components.mk

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -321,15 +321,22 @@ prepare-dist::
321321
# disable `make distclean` so $(DEPS_DIR) is not accidentally removed.
322322

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

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+
333340
ifeq ($(DISABLE_DISTCLEAN),1)
334341
ifneq ($(filter distclean distclean-deps,$(MAKECMDGOALS)),)
335342
SKIP_DEPS = 1

0 commit comments

Comments
 (0)