From: Lady Date: Sat, 25 Jan 2025 02:16:09 +0000 (-0500) Subject: Enable multiple DATADIR X-Git-Tag: 1.0.0~2 X-Git-Url: https://git.ladys.computer/Shushe/commitdiff_plain/7e39a36064ba7afc8c061ca5c2da125756014553?ds=sidebyside;hp=5c2f4a2d2c9913196c6092f0f72a8c4ff6e76752 Enable multiple DATADIR ⛩📰 书社 requires that `$(DATADIR)` point to at least one real directory before entering two‐step mode, but it failed to correctly handle this check in the case where there were multiple `$(DATADIR)` supplied. --- diff --git a/GNUmakefile b/GNUmakefile index 5634264..3ee32a5 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2023, 2024 Lady +# SPDX-FileCopyrightText: 2023, 2024, 2025 Lady # SPDX-License-Identifier: MPL-2.0 SHELL = /bin/sh @@ -746,7 +746,7 @@ else ifeq ($(MODE),urn:fdc:ladys.computer:20231231:Shu1She4:mode:initial) # ─ ¶ Non‐Recipe Variable Definitions ───────────────────────────────── # Non·empty if this is a two‐step build. -override twostep := $(if $(DATADIR),$(shell if $(TEST) -d $(call quote,$(DATADIR)); then $(PRINTF) '%s\n' '1'; fi),) +override twostep := $(if $(DATADIR),$(call not,$(shell for dir in $(foreach dir,$(DATADIR),$(call quote,$(dir))); do if $(TEST) '!' -d "$$dir"; then $(PRINTF) '%s\n' '0'; fi; done)),) # Pair each source magic file with its location in the build directory. override magicpair := $(foreach magicfile,$(MAGIC),$(magicfile)|$(BUILDDIR)/magic/$(call namehash,$(magicfile)))