From 27eec8a39f8bcfac00a292667273cc60100cd97b Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Wed, 28 Jun 2023 09:11:47 +0200 Subject: gradle.eclass: drop usage of compgen Bash's compgen builtin is only available if bash was built with readline support. And PMS does not require that this is the case. See also https://bugs.gentoo.org/909163 Signed-off-by: Florian Schmaus --- eclass/gradle.eclass | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/eclass/gradle.eclass b/eclass/gradle.eclass index 070a3e12..7595923d 100644 --- a/eclass/gradle.eclass +++ b/eclass/gradle.eclass @@ -105,20 +105,14 @@ gradle-set_EGRADLE() { return fi - local candidates candidate selected selected_ver + local candidate selected selected_ver ver - candidates=$(compgen -c gradle-) - for candidate in ${candidates}; do - if [[ ! ${candidate} =~ gradle(-bin)?-([.0-9]+) ]]; then + for candidate in "${BROOT}"/usr/bin/gradle-; do + if [[ ${candidate} != */gradle?(-bin)-+([.0-9]) ]]; then continue fi - local ver - if (( ${#BASH_REMATCH[@]} == 3 )); then - ver="${BASH_REMATCH[2]}" - else - ver="${BASH_REMATCH[1]}" - fi + ver=${candidate##*-} if [[ -n ${EGRADLE_EXACT_VER} ]]; then ver_test "${ver}" -ne "${EGRADLE_EXACT_VER}" && continue @@ -150,7 +144,7 @@ gradle-set_EGRADLE() { done if [[ -z ${selected} ]]; then - die "Could not find (suitable) gradle installation in PATH" + die "Could not find (suitable) gradle installation in ${BROOT}/usr/bin" fi EGRADLE="${selected}" -- cgit v1.2.3-65-gdbad