mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2024-12-28 09:52:09 +00:00
abuild: post check arch
We check if noarch is properly set
This commit is contained in:
parent
05c2443ad1
commit
5e41f09733
16
abuild.in
16
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..."
|
||||
(
|
||||
|
Loading…
Reference in New Issue
Block a user