From f7f8cf709198a5c9b8d3287bc427b3969ca1cdae Mon Sep 17 00:00:00 2001 From: Michal Vasilek Date: Mon, 20 Jun 2022 01:27:05 +0200 Subject: [PATCH] xbps-src: fix detecting subpackage availability --- common/xbps-src/shutils/pkgtarget.sh | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/common/xbps-src/shutils/pkgtarget.sh b/common/xbps-src/shutils/pkgtarget.sh index ba8c63bca8aa..df7e4828b623 100644 --- a/common/xbps-src/shutils/pkgtarget.sh +++ b/common/xbps-src/shutils/pkgtarget.sh @@ -16,14 +16,21 @@ check_existing_pkg() { check_pkg_arch() { local cross="$1" _arch f match nonegation - if [ -n "$archs" ]; then - if [ -n "$cross" ]; then - _arch="$XBPS_TARGET_MACHINE" - elif [ -n "$XBPS_ARCH" ]; then - _arch="$XBPS_ARCH" - else - _arch="$XBPS_MACHINE" + if [ -n "$cross" ]; then + _arch="$XBPS_TARGET_MACHINE" + elif [ -n "$XBPS_ARCH" ]; then + _arch="$XBPS_ARCH" + else + _arch="$XBPS_MACHINE" + fi + + if [ "$pkgname" != "$sourcepkg" ]; then + if ! echo "$subpackages" | grep -q -w "$pkgname"; then + report_broken "${pkgname}-${version}_${revision}: this subpackage cannot be built for ${_arch}.\n" fi + fi + + if [ -n "$archs" ]; then set -f for f in ${archs}; do set +f