summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2011-07-22 11:47:07 +0200
committerDan McGee <dan@archlinux.org>2011-07-27 19:45:12 +0200
commita7940e7419a6fb39eeafb0bfd053b90a64946d5c (patch)
treee945481830c69c6fdff0a9c5229e91147f44052d
parent819f6750047cbdb7ecb7fa4724f90e532cd73446 (diff)
downloadpacman-a7940e7419a6fb39eeafb0bfd053b90a64946d5c.tar.gz
pacman-a7940e7419a6fb39eeafb0bfd053b90a64946d5c.tar.xz
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>
-rw-r--r--scripts/makepkg.sh.in15
1 files changed, 15 insertions, 0 deletions
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/\\$//')