Commit 59df6276 authored by Natanael Copa's avatar Natanael Copa

abuild: multiarch support

- add arch to .PKGINFO
- exit with success if package is not in arch
parent 77a4140f
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment