chore(build): skip invalid architectures on autodetection

This is done so that pkgctl can be better used to build aur packages
which can have arch=(...) settings for which we do not have a clean
chroot builder.

Signed-off-by: Christian Heusel <christian@heusel.eu>
This commit is contained in:
Christian Heusel 2023-06-15 11:05:12 +02:00
parent 0ea7e9e0e5
commit 720b7c9b05
No known key found for this signature in database
GPG Key ID: C047D4F328B52585
1 changed files with 8 additions and 2 deletions

View File

@ -129,7 +129,7 @@ pkgctl_build() {
local WORKER_SLOT=
# variables
local path pkgbase pkgrepo source
local loop_arch path pkgbase pkgrepo source
while (( $# )); do
case $1 in
@ -318,7 +318,13 @@ pkgctl_build() {
if in_array any "${arch[@]}"; then
BUILD_ARCH=("${_arch[0]}")
else
BUILD_ARCH+=("${arch[@]}")
for loop_arch in "${arch[@]}"; do
if in_array "${loop_arch}" "${_arch[@]}"; then
BUILD_ARCH+=("$loop_arch")
else
warning 'invalid architecture, not building for: %s' "${loop_arch}"
fi
done
fi
fi