commit:     3313fb4c7829d383aa6596092c41c377905e711d
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 22 20:48:38 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Nov 22 20:51:38 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3313fb4c

cuda.eclass: adapt for newer GCC paths (major version only)

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

 eclass/cuda.eclass | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/eclass/cuda.eclass b/eclass/cuda.eclass
index 3dc8299c275c..81c8c1f2fc59 100644
--- a/eclass/cuda.eclass
+++ b/eclass/cuda.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 case "${EAPI:-0}" in
@@ -87,7 +87,7 @@ cuda_gccdir() {
        # Try the current gcc version first
        ver=$(gcc-version)
        if [[ -n "${ver}" ]] && [[ ${vers} =~ ${ver} ]]; then
-               dirs=( ${EPREFIX}/usr/*pc-linux-gnu/gcc-bin/${ver}*/ )
+               dirs=( ${EPREFIX}/usr/*pc-linux-gnu/gcc-bin/${ver%.*}*/ )
                gcc_bindir="${dirs[${#dirs[@]}-1]}"
        fi
 
@@ -96,14 +96,14 @@ cuda_gccdir() {
                ver=$(ver_cut 1-2 "${ver##*sys-devel/gcc-}")
 
                if [[ -n "${ver}" ]] && [[ ${vers} =~ ${ver} ]]; then
-                       dirs=( ${EPREFIX}/usr/*pc-linux-gnu/gcc-bin/${ver}*/ )
+                       dirs=( ${EPREFIX}/usr/*pc-linux-gnu/gcc-bin/${ver%.*}*/ 
)
                        gcc_bindir="${dirs[${#dirs[@]}-1]}"
                fi
        fi
 
        for ver in ${vers}; do
                if has_version "=sys-devel/gcc-${ver}*"; then
-                       dirs=( ${EPREFIX}/usr/*pc-linux-gnu/gcc-bin/${ver}*/ )
+                       dirs=( ${EPREFIX}/usr/*pc-linux-gnu/gcc-bin/${ver%.*}*/ 
)
                        gcc_bindir="${dirs[${#dirs[@]}-1]}"
                fi
        done

Reply via email to