From b9cae777898b60edf86a996cfed3fdfa732f76ff Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Mon, 17 Aug 2026 17:59:05 +0100 Subject: [PATCH] Makefile: collapse 'case ... esac' onto one shell line MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit make runs each recipe line in its own shell (typically /bin/sh = dash on Debian). A multi-line case/esac block — same gotcha as the earlier 'if/then/fi' — gets split across shells, and the second shell sees 'esac' as a stray keyword and bails: /bin/sh: 1: Syntax error: end of file unexpected (expecting ")") Collapse the case into a single line with a command substitution, then assign the result to DPKG_ARCH_ARGS. Same pattern as the single-line if/then/fi used later. --- Makefile | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 2ae51bb..8217d8e 100644 --- a/Makefile +++ b/Makefile @@ -49,11 +49,7 @@ deb: # For linux-x64, it sets the host arch to amd64 explicitly # (which matches the runner — no-op, but keeps the call site # uniform). Other RIDs are rejected. - case "$(POSTIT_RUNTIME)" in - linux-arm64) DPKG_ARCH_ARGS="-aarm64" ;; - linux-x64) DPKG_ARCH_ARGS="-aamd64" ;; - *) echo " ERROR: unsupported POSTIT_RUNTIME=$(POSTIT_RUNTIME)" >&2; exit 1 ;; - esac + 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) # dpkg-architecture with no -t/-a flags just prints the arch # info; with -aarm64, it exports the variables needed for a # cross-build targeting arm64. Use 'eval' to put those vars