From 259e6631dde4139d00a34ab2a49b1f9682558c89 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 27 May 2026 13:02:37 -0500 Subject: [PATCH] Fix duplicate DOCS entries when asciidoctor is present When asciidoctor is installed, DOCS is built by two paths: - Line 23: $(wildcard doc/*) picks up any committed .html files - Line 135: ASCIIDOC_HTML adds the generated .html targets If a .html file is committed alongside its .adoc source (as in doc/object_reference.html + doc/object_reference.adoc), the file appears in DOCS twice. This causes `install` to pass the same path to /usr/bin/install twice in a single invocation, which fails with: install: will not overwrite just-created '...html' with '...html' Fix by using $(filter-out) to remove any ASCIIDOC_HTML entries already present in DOCS before appending them, then $(sort) to deduplicate. This matches the approach already taken in Postgres-Extensions/pgxntool 2.x. --- pgxntool/base.mk | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pgxntool/base.mk b/pgxntool/base.mk index ce918db..fb002e6 100644 --- a/pgxntool/base.mk +++ b/pgxntool/base.mk @@ -131,8 +131,10 @@ dist: html # But don't add it as an install or test dependency unless we do have asciidoc ifneq (,$(strip $(ASCIIDOC))) -# Need to do this so install & co will pick up ALL targets. Unfortunately this can result in some duplication. -DOCS += $(ASCIIDOC_HTML) +# Need to do this so install & co will pick up ALL targets. Use filter-out to +# avoid duplicating html files that are already in DOCS (e.g. committed .html +# alongside their .adoc source). +DOCS := $(sort $(filter-out $(ASCIIDOC_HTML),$(DOCS)) $(ASCIIDOC_HTML)) # Also need to add html as a dep to all (which will get picked up by install & installcheck all: html