From 13567819ca85a8114105b76aaa6353122ac49448 Mon Sep 17 00:00:00 2001 From: nevaforget Date: Mon, 20 Apr 2026 12:43:44 +0200 Subject: [PATCH] fix(ci): source PKGBUILD to read makedepends reliably --- .gitea/workflows/build-and-publish.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/build-and-publish.yaml b/.gitea/workflows/build-and-publish.yaml index b83929c..3216620 100644 --- a/.gitea/workflows/build-and-publish.yaml +++ b/.gitea/workflows/build-and-publish.yaml @@ -45,8 +45,10 @@ jobs: # depends check via -d. Rationale: moonarch-git's runtime depends # include AUR-only packages (stasis, auto-cpufreq, ttf-ubuntusans-nerd) # which pacman can't resolve. Those deps aren't needed at build time. - MAKEDEPS=$(awk '/^makedepends=\(/,/^\)/' PKGBUILD | grep -oE "'[^']+'" | tr -d "'" | tr '\n' ' ') - if [ -n "$MAKEDEPS" ]; then + # Source the PKGBUILD in a subshell to read the array robustly — + # awk/grep parsing breaks on single-line vs multi-line formats. + MAKEDEPS=$(bash -c 'source ./PKGBUILD 2>/dev/null; printf "%s " "${makedepends[@]}"') + if [ -n "${MAKEDEPS// }" ]; then # shellcheck disable=SC2086 sudo pacman -S --needed --noconfirm $MAKEDEPS fi