From b57be870448b58d44bcd07b0ade631f96548aacc Mon Sep 17 00:00:00 2001 From: Piraty Date: Tue, 22 Sep 2020 11:56:38 +0200 Subject: xgensum: handle packages unavailable for host arch Detect if the package is unavailable for the host architecture and pick the first supported arch. Packages like bootloaders and kernels for arm boards obviously restrict `archs=` which might exclude the host's architecture. Therefore xbps-src couldn't fetch the distfiles without specifying `-a `. --- xgensum | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/xgensum b/xgensum index 448c552..a55ab56 100755 --- a/xgensum +++ b/xgensum @@ -32,6 +32,13 @@ fi . "$template" +# pick the first supported arch. This is required for packages unavailable for +# the host arch +FLAG_a= +if ! "$XBPS_DISTDIR/xbps-src" show-avail $pkgname ; then + FLAG_a="-a $("$XBPS_DISTDIR/xbps-src" show $pkgname | sed -En -e 's/archs:[[:space:]]*([.*]*)/\1/p' | sed -e 's/\*$//' | grep -v -e '^~' | head -n1 )" +fi + # Try to source the build-style as well. This is required for R-cran packages. if [ -f "${XBPS_DISTDIR}/common/environment/build-style/${build_style}.sh" ]; then . "${XBPS_DISTDIR}/common/environment/build-style/${build_style}.sh" @@ -50,7 +57,7 @@ if [ "$FLAG_f" = -f ]; then "$XBPS_DISTDIR/xbps-src" $FLAG_h -I clean $pkgname fi -"$XBPS_DISTDIR/xbps-src" $FLAG_h -I fetch $pkgname +"$XBPS_DISTDIR/xbps-src" $FLAG_h $FLAG_a -I fetch $pkgname ret=0 sums="" -- cgit 1.4.1