From 99bdf0923f57996f750b4ae1bcacbf25540dd569 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Mon, 17 Aug 2026 18:25:28 +0100 Subject: [PATCH] Makefile: escape $(...) so make doesn't pre-evaluate it The previous version had $(dpkg-architecture $DPKG_ARCH_ARGS). make expands $(...) at parse time, BEFORE any bash command runs. So make called 'dpkg-architecture' (no -a flag, because $DPKG_ARCH_ARGS is empty at parse time) and substituted the amd64 DEB_* vars into the recipe line. Bash then ran with the amd64 vars baked in, regardless of what the runtime DPKG_ARCH_ARGS ended up being. Escape both dollars: $$ -> $, so make sees '$$' and passes '$$' to bash, which sees '$(...)' and evaluates it at runtime after DPKG_ARCH_ARGS is set on the previous command. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 2e64400..db104b0 100644 --- a/Makefile +++ b/Makefile @@ -54,7 +54,7 @@ deb: # vars set by dpkg-architecture are visible to dpkg-buildpackage. # make runs each recipe line in its own shell, so we use # backslash continuation to glue everything together. - DPKG_ARCH_ARGS=$$(case "$(POSTIT_RUNTIME)" in linux-arm64) echo "-aarm64" ;; linux-x64) echo "-aamd64" ;; *) echo "unsupported POSTIT_RUNTIME=$(POSTIT_RUNTIME)" >&2; exit 1 ;; esac); eval $(dpkg-architecture $$DPKG_ARCH_ARGS); POSTIT_GIT_URL=$(POSTIT_GIT_URL) POSTIT_GIT_TAG=$(POSTIT_GIT_TAG) POSTIT_RUNTIME=$(POSTIT_RUNTIME) dpkg-buildpackage -us -uc -b + DPKG_ARCH_ARGS=$$(case "$(POSTIT_RUNTIME)" in linux-arm64) echo "-aarm64" ;; linux-x64) echo "-aamd64" ;; *) echo "unsupported POSTIT_RUNTIME=$(POSTIT_RUNTIME)" >&2; exit 1 ;; esac); eval $$(dpkg-architecture $$DPKG_ARCH_ARGS); POSTIT_GIT_URL=$(POSTIT_GIT_URL) POSTIT_GIT_TAG=$(POSTIT_GIT_TAG) POSTIT_RUNTIME=$(POSTIT_RUNTIME) dpkg-buildpackage -us -uc -b # dpkg-buildpackage already writes the produced .deb to # /src/_src/../ = $POSTIT_OUT_DIR (its default — there's no # flag to change it). So no 'mv' is needed. The old 'mv'