summaryrefslogtreecommitdiff
path: root/abuild.in
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-12-30 10:36:42 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-12-30 10:36:42 +0000
commit5e41f09733ddbf245483441e5824c52b25bbedb4 (patch)
treee6a90139a11d66492fb9de4e815027edff882461 /abuild.in
parent05c2443ad1c57a5ce89004c986c9c70a4216335b (diff)
downloadabuild-5e41f09733ddbf245483441e5824c52b25bbedb4.tar.gz
abuild-5e41f09733ddbf245483441e5824c52b25bbedb4.tar.bz2
abuild-5e41f09733ddbf245483441e5824c52b25bbedb4.tar.xz
abuild-5e41f09733ddbf245483441e5824c52b25bbedb4.zip
abuild: post check arch
We check if noarch is properly set
Diffstat (limited to 'abuild.in')
-rwxr-xr-xabuild.in16
1 files changed, 16 insertions, 0 deletions
diff --git a/abuild.in b/abuild.in
index e5809dc..b169707 100755
--- a/abuild.in
+++ b/abuild.in
@@ -576,6 +576,21 @@ trace_apk_deps() {
done
}
+# check that noarch is set if needed
+arch_check() {
+ local name=$1
+ local dir="$2"
+ if [ -z "$(scanelf -R "$dir" | head -n 1)" ]; then
+ [ "$arch" = "noarch" ] && return 0
+ warning "No elf files found for $name so arch should probably be set to \"noarch\""
+ else
+ [ "$arch" != "noarch" ] && return 0
+ error "Elf files found so arch must not be set to \"noarch\""
+ return 1
+ fi
+ return 0
+}
+
create_apks() {
local file
getpkgver || return 1
@@ -586,6 +601,7 @@ create_apks() {
local apk=$name-$ver.apk
local datadir="$pkgbasedir"/$name
+ arch_check "$name" "$datadir" || return 1
trace_apk_deps "$name" "$dir" || return 1
msg "Creating $apk..."
(