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

abuild: multiarch support

- add arch to .PKGINFO
- exit with success if package is not in arch
parent 77a4140f
...@@ -391,6 +391,10 @@ prepare_metafiles() { ...@@ -391,6 +391,10 @@ prepare_metafiles() {
mkdir -p "$controldir" mkdir -p "$controldir"
local builddate=$(date -u "+%s") local builddate=$(date -u "+%s")
local size=$(du -sk | awk '{print $1 * 1024}') 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" echo "# Generated by $(basename $0) $abuild_ver" >"$pkginfo"
if [ -n "$FAKEROOTKEY" ]; then if [ -n "$FAKEROOTKEY" ]; then
...@@ -405,6 +409,7 @@ url = $url ...@@ -405,6 +409,7 @@ url = $url
builddate = $builddate builddate = $builddate
packager = ${PACKAGER:-"Unknown"} packager = ${PACKAGER:-"Unknown"}
size = $size size = $size
arch = $parch
EOF EOF
local i deps local i deps
deps="$depends" deps="$depends"
...@@ -727,6 +732,11 @@ srcpkg() { ...@@ -727,6 +732,11 @@ srcpkg() {
(cd .. && tar -zcf "$PKGDEST/$p.src.tar.gz" $files) (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 # check if package is up to date
apk_up2date() { apk_up2date() {
getpkgver || return 1 getpkgver || return 1
...@@ -763,6 +773,7 @@ abuildindex_up2date() { ...@@ -763,6 +773,7 @@ abuildindex_up2date() {
} }
up2date() { up2date() {
check_arch || return 0
apk_up2date && abuildindex_up2date apk_up2date && abuildindex_up2date
} }
...@@ -1049,6 +1060,7 @@ uninstalldeps (){ ...@@ -1049,6 +1060,7 @@ uninstalldeps (){
} }
all() { all() {
check_arch || return 0
if up2date && [ -z "$force" ]; then if up2date && [ -z "$force" ]; then
msg "Package is up to date" msg "Package is up to date"
else 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