Makefile: use ';' to chain eval and dpkg-buildpackage, not '&&'
Some checks failed
Forgejo Release postit-deb / release (push) Failing after 4m14s

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.
This commit is contained in:
Paul Schneider 2026-08-17 18:16:37 +01:00
commit 27df78bf5e
No known key found for this signature in database
GPG key ID: 1E66C65EE2B46F1B

View file

@ -54,7 +54,7 @@ deb:
# vars set by dpkg-architecture are visible to dpkg-buildpackage. # vars set by dpkg-architecture are visible to dpkg-buildpackage.
# make runs each recipe line in its own shell, so we use # make runs each recipe line in its own shell, so we use
# backslash continuation to glue everything together. # 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 # dpkg-buildpackage already writes the produced .deb to
# /src/_src/../ = $POSTIT_OUT_DIR (its default — there's no # /src/_src/../ = $POSTIT_OUT_DIR (its default — there's no
# flag to change it). So no 'mv' is needed. The old 'mv' # flag to change it). So no 'mv' is needed. The old 'mv'