From 51c71ea78d483eeea2305de6f6832b6981b97496 Mon Sep 17 00:00:00 2001 From: braceyourself Date: Wed, 25 Feb 2026 14:27:37 -0500 Subject: [PATCH] =?UTF-8?q?fix:=20metadata=20build=20target=20=E2=80=94=20?= =?UTF-8?q?gawk=20dependency,=20missing=20redirect,=20missing=20HEAD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `make build` fails on systems where `awk` is mawk (Ubuntu, Debian, and derivatives) because the `metadata` target uses `awk -i inplace`, a gawk-only extension. Make aborts on the error, leaving `lib/prefs/metadata.js` truncated — which crashes the preferences dialog: SyntaxError: expected expression, got end of script Two additional bugs in the same target: - `git shortlog -sne` output goes to stdout instead of the file (missing `>>`), so the developers array is always empty even on gawk systems where the build succeeds - Without an explicit `HEAD` argument, `git shortlog` reads from stdin in non-interactive environments (CI, makepkg, rpmbuild), producing no output Replaces gawk-only `awk -i inplace` with portable `sed -i -E`. Redirects shortlog output to the file with explicit `HEAD`. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index f9ecee2..606b2c6 100644 --- a/Makefile +++ b/Makefile @@ -21,8 +21,8 @@ patchcss: metadata: echo "export const developers = Object.entries([" > lib/prefs/metadata.js - git shortlog -sne || echo "" >> lib/prefs/metadata.js - awk -i inplace '!/dependabot|noreply/' lib/prefs/metadata.js + git shortlog -sne HEAD >> lib/prefs/metadata.js || echo "" >> lib/prefs/metadata.js + sed -i -E '/dependabot|noreply/d' lib/prefs/metadata.js sed -i 's/^[[:space:]]*[0-9]*[[:space:]]*\(.*\) <\(.*\)>/ {name:"\1", email:"\2"},/g' lib/prefs/metadata.js echo "].reduce((acc, x) => ({ ...acc, [x.email]: acc[x.email] ?? x.name }), {})).map(([email, name]) => name + ' <' + email + '>')" >> lib/prefs/metadata.js