abuid: check that CARCH and CHOST is set

This commit is contained in:
Natanael Copa 2010-12-13 07:35:09 +00:00
parent 8f17e03078
commit a111620bc8
1 changed files with 11 additions and 1 deletions

View File

@ -94,7 +94,7 @@ die() {
# check if apkbuild is basicly sane
sanitycheck() {
local i
local i suggestion
msg "Checking sanity of $APKBUILD..."
[ -z "$pkgname" ] && die "Missing pkgname in APKBUILD"
[ -z "${pkgname##* *}" ] && die "pkgname contains spaces"
@ -108,6 +108,16 @@ sanitycheck() {
[ -z "$url" ] && die "Missing url in APKBUILD"
[ -z "$license" ] && die "Missing license in APKBULID"
# check if CARCH, CBUILD, CHOST and CTARGET is set
if [ -z "$CARCH" ]; then
case "$(uname -m)" in
i[0-9]86) suggestion=" (Suggestion: CARCH=x86)";;
x86_64) suggestion=" (Suggestion: CARCH=x86_64)";;
esac
die "Please set CARCH in /etc/abuild.conf$suggestion"
fi
[ -z "$CHOST" ] && die "Please set CHOST in /etc/abuild.conf"
for i in $install; do
[ -e "$startdir/$i" ] || die "install script $startdir/$i is missing"
done