summaryrefslogtreecommitdiff
path: root/abuild.in
diff options
context:
space:
mode:
Diffstat (limited to 'abuild.in')
-rwxr-xr-xabuild.in12
1 files changed, 12 insertions, 0 deletions
diff --git a/abuild.in b/abuild.in
index fa85f59..5556411 100755
--- a/abuild.in
+++ b/abuild.in
@@ -391,6 +391,10 @@ prepare_metafiles() {
mkdir -p "$controldir"
local builddate=$(date -u "+%s")
local size=$(du -sk | awk '{print $1 * 1024}')
+ local parch="$CARCH"
+ if [ "$arch" = "noarch" ]; then
+ parch="noarch"
+ fi
echo "# Generated by $(basename $0) $abuild_ver" >"$pkginfo"
if [ -n "$FAKEROOTKEY" ]; then
@@ -405,6 +409,7 @@ url = $url
builddate = $builddate
packager = ${PACKAGER:-"Unknown"}
size = $size
+arch = $parch
EOF
local i deps
deps="$depends"
@@ -727,6 +732,11 @@ srcpkg() {
(cd .. && tar -zcf "$PKGDEST/$p.src.tar.gz" $files)
}
+# return true if arch is supported or noarch
+check_arch() {
+ list_has $CARCH $arch || list_has noarch $arch
+}
+
# check if package is up to date
apk_up2date() {
getpkgver || return 1
@@ -763,6 +773,7 @@ abuildindex_up2date() {
}
up2date() {
+ check_arch || return 0
apk_up2date && abuildindex_up2date
}
@@ -1049,6 +1060,7 @@ uninstalldeps (){
}
all() {
+ check_arch || return 0
if up2date && [ -z "$force" ]; then
msg "Package is up to date"
else