summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-12-14 13:27:00 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-12-14 13:27:00 +0000
commit59df6276130f52c7724d5028e848172a440b7593 (patch)
tree96e4fe570936b3ff12b57398c553fc05794e2aad
parent77a4140f390427c1b0823187a5729eef5431c2a6 (diff)
downloadabuild-59df6276130f52c7724d5028e848172a440b7593.tar.bz2
abuild-59df6276130f52c7724d5028e848172a440b7593.tar.xz
abuild: multiarch support
- add arch to .PKGINFO - exit with success if package is not in arch
-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