fix(build): avoid trying to download none existing debug packages

Since last release, offload building now has proper error handling
enabled. This unfortunately lead to a regression for packages, like any
packages, where makepkg claims debug packages are available during
--packagelist while none were actually built. This leads to the scp
command failing when trying to download the none existing packages
which ultimately leads to a termination of the build script.

Fix this by filtering out package files that do not exist before trying
to download them.

Fixes #208

Component: pkgctl build
Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
This commit is contained in:
Levente Polyak 2024-02-08 21:29:55 +01:00
parent f6b1b1ba45
commit 0469d3c902
No known key found for this signature in database
GPG Key ID: FC1B547C8D8172C8
1 changed files with 3 additions and 1 deletions

View File

@ -114,7 +114,9 @@ mapfile -t files < <(
if [[ -f /usr/share/devtools/makepkg.conf.d/'"${repo}"'-'"${arch}"'.conf ]]; then
makepkg_config="/usr/share/devtools/makepkg.conf.d/'"${repo}"'-'"${arch}"'.conf"
fi &&
makepkg --config <(cat "${makepkg_user_config}" "${makepkg_config}" 2>/dev/null) --packagelist &&
while read -r file; do
[[ -f "${file}" ]] && printf "%s\n" "${file}" ||:
done < <(makepkg --config <(cat "${makepkg_user_config}" "${makepkg_config}" 2>/dev/null) --packagelist) &&
printf "%s\n" "${temp}/PKGBUILD"
')