From 27df78bf5e16379d18669ce2c97b9578c109e192 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Mon, 17 Aug 2026 18:16:37 +0100 Subject: [PATCH] Makefile: use ';' to chain eval and dpkg-buildpackage, not '&&' The '&&' between 'eval' and 'dpkg-buildpackage' was eating the arguments to eval because make's substitution of the $(dpkg-architecture $DPKG_ARCH_ARGS) command substitution is visible only at runtime, not in the make pre-processing. Bash then saw 'eval' followed by '&&' (with the substituted command becoming a separate statement) and ran eval with no arguments, leaving DEB_HOST_ARCH unset. With ';', the three commands are one statement and bash evaluates them left-to-right: assign DPKG_ARCH_ARGS, eval the dpkg-architecture output to populate DEB_HOST_ARCH etc., then call dpkg-buildpackage which inherits the DEB_* vars. Verified locally that 'eval $(dpkg-architecture -aarm64)' sets DEB_HOST_ARCH=arm64 in the current shell. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a40f959..2e64400 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'