common/hooks: simplify setting arch for binpkg

setup_pkg always export XBPS_TARGET_MACHINE
This commit is contained in:
Piotr Wójcik 2021-08-23 19:11:13 +02:00 committed by Piotr
parent 2201886262
commit 7b7d385f8b
2 changed files with 2 additions and 17 deletions

View file

@ -104,15 +104,7 @@ hook() {
local arch= binpkg= repo= _pkgver= _desc= _pkgn= _pkgv= _provides= \
_replaces= _reverts= f= found_dbg_subpkg=
if [ -n "$XBPS_TARGET_MACHINE" ]; then
arch=$XBPS_TARGET_MACHINE
else
arch=$XBPS_MACHINE
fi
if [ -z "$XBPS_CROSS_BUILD" -a -n "$XBPS_ARCH" -a "$XBPS_ARCH" != "$XBPS_TARGET_MACHINE" ]; then
arch=${XBPS_ARCH}
fi
arch=$XBPS_TARGET_MACHINE
binpkg=${pkgver}.${arch}.xbps
if [ -n "$repository" ]; then

View file

@ -13,19 +13,12 @@ registerpkg() {
hook() {
local arch= binpkg= pkgdir=
if [ -n "$XBPS_TARGET_MACHINE" ]; then
arch=$XBPS_TARGET_MACHINE
else
arch=$XBPS_MACHINE
fi
if [ -z "$XBPS_CROSS_BUILD" -a -n "$XBPS_ARCH" -a "$XBPS_ARCH" != "$XBPS_TARGET_MACHINE" ]; then
arch=${XBPS_ARCH}
fi
if [ -n "$repository" ]; then
pkgdir=$XBPS_REPOSITORY/$repository
else
pkgdir=$XBPS_REPOSITORY
fi
arch=$XBPS_TARGET_MACHINE
binpkg=${pkgver}.${arch}.xbps
binpkg32=${pkgname}-32bit-${version}_${revision}.x86_64.xbps
binpkg_dbg=${pkgname}-dbg-${version}_${revision}.${arch}.xbps