fix(ci): source PKGBUILD to read makedepends reliably
This commit is contained in:
parent
386046b98c
commit
13567819ca
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user