commit:     1931c98f78d988cdfe03c247443de010de45f30b
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 16 10:32:51 2023 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Fri Jun 16 21:39:59 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1931c98f

common-lisp-3.eclass: Don't call readarray -d unless >=bash-5.0

Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 eclass/common-lisp-3.eclass | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/eclass/common-lisp-3.eclass b/eclass/common-lisp-3.eclass
index cd654f37b904..b2dbff3513de 100644
--- a/eclass/common-lisp-3.eclass
+++ b/eclass/common-lisp-3.eclass
@@ -126,8 +126,16 @@ common-lisp-install-sources() {
                        common-lisp-install-one-source ${fpredicate} "${path}" 
"$(dirname "${path}")"
                elif [[ -d ${path} ]] ; then
                        local files
-                       readarray -d '' files < <(find "${path}" -type f 
-print0 || die "cannot traverse ${path}" )
-                       common-lisp-install-sources -t ${ftype} "${files[@]}" 
|| die
+                       # test can be dropped in EAPI 8 which guarantees 
bash-5.0
+                       if [[ ${BASH_VERSINFO[0]} -ge 5 ]]; then
+                               readarray -d '' files < <(find "${path}" -type 
f -print0 \
+                                                                               
        || die "cannot traverse ${path}")
+                       else
+                               # readarray has no -d option in bash-4.2
+                               readarray -t files < <(find "${path}" -type f 
-print \
+                                                                               
        || die "cannot traverse ${path}")
+                       fi
+                       common-lisp-install-sources -t ${ftype} "${files[@]}"
                else
                        die "${path} is neither a regular file nor a directory"
                fi

Reply via email to