diff options
author | 2024-01-17 14:14:41 +0100 | |
---|---|---|
committer | 2024-01-19 13:43:46 +0100 | |
commit | d589f4e4bbd55b37de3871f1a2bf5e59a679d177 (patch) | |
tree | 6d4f042163bded606e0031ce21058c061bba7bdd /eclass | |
parent | java-pkg-simple.eclass: make code related to java 9+ actually execute (diff) | |
download | gentoo-d589f4e4bbd55b37de3871f1a2bf5e59a679d177.tar.gz gentoo-d589f4e4bbd55b37de3871f1a2bf5e59a679d177.tar.bz2 gentoo-d589f4e4bbd55b37de3871f1a2bf5e59a679d177.zip |
java-pkg-simple.eclass: cut possible prefix to allow integer comparison
Signed-off-by: Manuel Mommertz <manuel.mommertz@desy.de>
Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/java-pkg-simple.eclass | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/eclass/java-pkg-simple.eclass b/eclass/java-pkg-simple.eclass index 7bd2599a142d..990b09f73c00 100644 --- a/eclass/java-pkg-simple.eclass +++ b/eclass/java-pkg-simple.eclass @@ -367,7 +367,8 @@ java-pkg-simple_src_compile() { # gather sources # if target < 9, we need to compile module-info.java separately # as this feature is not supported before Java 9 - if [[ $(java-pkg_get-target) -lt 9 ]]; then + local target="$(java-pkg_get-target)" + if [[ ${target#1.} -lt 9 ]]; then find "${JAVA_SRC_DIR[@]}" -name \*.java ! -name module-info.java > ${sources} moduleinfo=$(find "${JAVA_SRC_DIR[@]}" -name module-info.java) else @@ -382,7 +383,7 @@ java-pkg-simple_src_compile() { java-pkg-simple_getclasspath java-pkg-simple_prepend_resources ${classes} "${JAVA_RESOURCE_DIRS[@]}" - if [[ -n ${moduleinfo} ]] || [[ $(java-pkg_get-target) -lt 9 ]]; then + if [[ -n ${moduleinfo} ]] || [[ ${target#1.} -lt 9 ]]; then ejavac -d ${classes} -encoding ${JAVA_ENCODING}\ ${classpath:+-classpath ${classpath}} ${JAVAC_ARGS} @${sources} else @@ -528,7 +529,8 @@ java-pkg-simple_src_test() { # gathering sources for testing # if target < 9, we need to compile module-info.java separately # as this feature is not supported before Java 9 - if [[ $(java-pkg_get-target) -lt 9 ]]; then + local target="$(java-pkg_get-target)" + if [[ ${target#1.} -lt 9 ]]; then find "${JAVA_TEST_SRC_DIR[@]}" -name \*.java ! -name module-info.java > ${test_sources} moduleinfo=$(find "${JAVA_TEST_SRC_DIR[@]}" -name module-info.java) else @@ -537,7 +539,7 @@ java-pkg-simple_src_test() { # compile if [[ -s ${test_sources} ]]; then - if [[ -n ${moduleinfo} ]] || [[ $(java-pkg_get-target) -lt 9 ]]; then + if [[ -n ${moduleinfo} ]] || [[ ${target#1.} -lt 9 ]]; then ejavac -d ${classes} -encoding ${JAVA_ENCODING}\ ${classpath:+-classpath ${classpath}} ${JAVAC_ARGS} @${test_sources} else |