makepkg: check arch overrides for required architecture

Check any overrides of the "arch" variable contain the required
architecture.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Allan McRae 2011-07-22 19:47:07 +10:00 committed by Dan McGee
parent 819f675004
commit a7940e7419
1 changed files with 15 additions and 0 deletions

View File

@ -1376,6 +1376,21 @@ check_sanity() {
fi
fi
if (( ${#pkgname[@]} > 1 )); then
for i in ${pkgname[@]}; do
local arch_list=""
eval $(declare -f package_${i} | sed -n 's/\(^[[:space:]]*arch=\)/arch_list=/p')
if [[ ${arch_list[@]} && ${arch_list} != 'any' ]]; then
if ! in_array $CARCH ${arch_list[@]}; then
if (( ! IGNOREARCH )); then
error "$(gettext "%s is not available for the '%s' architecture.")" "$i" "$CARCH"
ret=1
fi
fi
fi
done
fi
local provides_list=()
eval $(awk '/^[[:space:]]*provides=/,/\)/' "$BUILDFILE" | \
sed -e "s/provides=/provides_list+=/" -e "s/#.*//" -e 's/\\$//')