diff options
author | 2023-06-28 09:11:47 +0200 | |
---|---|---|
committer | 2023-06-28 09:11:47 +0200 | |
commit | 27eec8a39f8bcfac00a292667273cc60100cd97b (patch) | |
tree | 59ede23efbfd0a3c6d6eeaed8d3187134a06d16c | |
parent | gradle.eclass: drop unnecessary export (diff) | |
download | java-27eec8a39f8bcfac00a292667273cc60100cd97b.tar.gz java-27eec8a39f8bcfac00a292667273cc60100cd97b.tar.bz2 java-27eec8a39f8bcfac00a292667273cc60100cd97b.zip |
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 <flow@gentoo.org>
-rw-r--r-- | eclass/gradle.eclass | 16 |
1 files 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}" |