commit:     5bb8b81487743b3e643c5a332d256cb69aca4569
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 17 12:21:42 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Dec 17 12:21:42 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5bb8b814

dev-lang/ada-bootstrap: handle arches where we have multiple tarballs available

Otherwise, we might have ${A} containing more than one and then we unpack
the last one listed (which isn't necessarily right at all) and also fail
w/ wrong number of args to dosym.

Bug: https://bugs.gentoo.org/940472
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-lang/ada-bootstrap/ada-bootstrap-14.ebuild | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/dev-lang/ada-bootstrap/ada-bootstrap-14.ebuild 
b/dev-lang/ada-bootstrap/ada-bootstrap-14.ebuild
index 09b42c8b122b..56e5fd4b54d1 100644
--- a/dev-lang/ada-bootstrap/ada-bootstrap-14.ebuild
+++ b/dev-lang/ada-bootstrap/ada-bootstrap-14.ebuild
@@ -59,8 +59,30 @@ RDEPEND="
        virtual/libiconv
 "
 
+src_unpack() {
+       # We want to unpack only the appropriate tarball for CHOST (e.g. on 
arm).
+       TARBALL_TO_UNPACK=
+
+       local archive
+       for archive in ${A} ; do
+               local tarball_chost=${archive/${P}-}
+               tarball_chost=${tarball_chost%%.gpkg.tar}
+
+               if [[ ${tarball_chost} == ${CHOST} ]] ; then
+                       TARBALL_TO_UNPACK=${archive}
+                       break
+               fi
+       done
+
+       if [[ -z ${TARBALL_TO_UNPACK} ]] ; then
+               die "No tarball found for CHOST=${CHOST}. Please file a bug at 
bugs.gentoo.org."
+       fi
+
+       unpack_gpkg "${TARBALL_TO_UNPACK}"
+}
+
 src_install() {
-       local chost=${A/${P}-}
+       local chost=${TARBALL_TO_UNPACK/${P}-}
        chost=${chost%%.gpkg.tar}
 
        dodir /usr/lib/ada-bootstrap

Reply via email to