From a7940e7419a6fb39eeafb0bfd053b90a64946d5c Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Fri, 22 Jul 2011 19:47:07 +1000 Subject: makepkg: check arch overrides for required architecture Check any overrides of the "arch" variable contain the required architecture. Signed-off-by: Allan McRae Signed-off-by: Dan McGee --- scripts/makepkg.sh.in | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index da1cec85..0dfbc5d5 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -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/\\$//') -- cgit v1.2.3-70-g09d2