abuild: multiarch support

- add arch to .PKGINFO
- exit with success if package is not in arch
This commit is contained in:
Natanael Copa 2010-12-14 13:27:00 +00:00
parent 77a4140f39
commit 59df627613

View File

@ -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
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() {
(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() {
} }
up2date() { up2date() {
check_arch || return 0
apk_up2date && abuildindex_up2date apk_up2date && abuildindex_up2date
} }
@ -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