From 30b5fe02a1cf4740d3ace4041614619f690cf2e7 Mon Sep 17 00:00:00 2001 From: wang--ge Date: Tue, 20 Feb 2024 11:22:11 +0800 Subject: [PATCH] compatible adapter for version 1.8 --- 0008-compatible-for-version-1.8.patch | 89 +++++++++++++++++++++++++++ groovy.spec | 6 +- 2 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 0008-compatible-for-version-1.8.patch diff --git a/0008-compatible-for-version-1.8.patch b/0008-compatible-for-version-1.8.patch new file mode 100644 index 0000000..72a64b1 --- /dev/null +++ b/0008-compatible-for-version-1.8.patch @@ -0,0 +1,89 @@ +From bfe732cf53ad19c9a8e6db3af595e728cf2bacfa Mon Sep 17 00:00:00 2001 +From: wang--ge +Date: Mon, 5 Feb 2024 09:56:34 +0800 +Subject: [PATCH] compatible for version 1.8 + +--- + src/bin/startGroovy | 45 +++++++++++++++++++++++++++++++-------------- + 1 file changed, 31 insertions(+), 14 deletions(-) + +diff --git a/src/bin/startGroovy b/src/bin/startGroovy +index 36d6edd..9fcccc4 100644 +--- a/src/bin/startGroovy ++++ b/src/bin/startGroovy +@@ -28,7 +28,6 @@ + ## $Revision$ + ## $Date$ + ## +- + PROGNAME=`basename "$0"` + + #DIRNAME=`dirname "$0"` +@@ -150,7 +149,6 @@ fi + if [ -z "$GROOVY_CONF" ] ; then + GROOVY_CONF="$GROOVY_HOME/conf/groovy-starter.conf" + fi +-STARTER_CLASSPATH="$GROOVY_HOME/lib/@GROOVYJAR@" + + # Create the final classpath. Setting a classpath using the -cp or -classpath option means not to use the + # global classpath. Groovy behaves then the same as the java interpreter +@@ -162,6 +160,11 @@ else + CP=. + fi + ++STARTER_CLASSPATH="$GROOVY_HOME/lib/@GROOVYJAR@" ++if [ ${GROOVY_VERSION} == "1.8" ];then ++ STARTER_CLASSPATH="/usr/share/java/groovy-1.8.jar:$CP" ++fi ++ + # Determine the Java command to use to start the JVM. + if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then +@@ -283,18 +286,32 @@ startGroovy ( ) { + if $useprofiler ; then + runProfiler + else +- eval exec "\"\$JAVACMD\"" $JAVA_OPTS \ +- -classpath "\"\$STARTER_CLASSPATH\"" \ +- -Dscript.name="\"\$SCRIPT_PATH\"" \ +- -Dprogram.name="\"\$PROGNAME\"" \ +- -Dgroovy.starter.conf="\"\$GROOVY_CONF\"" \ +- -Dgroovy.home="\"\$GROOVY_HOME\"" \ +- -Dtools.jar="\"\$TOOLS_JAR\"" \ +- $STARTER_MAIN_CLASS \ +- --main $CLASS \ +- --conf "\"\$GROOVY_CONF\"" \ +- --classpath "\"\$CP\"" \ +- "\"\$@\"" ++ if [ ${GROOVY_VERSION} == "1.8" ];then ++ eval exec "\"\$JAVACMD\"" $JAVA_OPTS \ ++ -classpath "\"\$STARTER_CLASSPATH\"" \ ++ -Dscript.name="\"\$SCRIPT_PATH\"" \ ++ -Dprogram.name="\"\$PROGNAME\"" \ ++ -Dgroovy.starter.conf="\"\$GROOVY_CONF\"" \ ++ -Dgroovy.home="\"\$GROOVY_HOME\"" \ ++ -Dtools.jar="\"\$TOOLS_JAR\"" \ ++ $STARTER_MAIN_CLASS \ ++ --main $CLASS \ ++ --conf "\"\$GROOVY_CONF\"" \ ++ "\"\$@\"" ++ else ++ eval exec "\"\$JAVACMD\"" $JAVA_OPTS \ ++ -classpath "\"\$STARTER_CLASSPATH\"" \ ++ -Dscript.name="\"\$SCRIPT_PATH\"" \ ++ -Dprogram.name="\"\$PROGNAME\"" \ ++ -Dgroovy.starter.conf="\"\$GROOVY_CONF\"" \ ++ -Dgroovy.home="\"\$GROOVY_HOME\"" \ ++ -Dtools.jar="\"\$TOOLS_JAR\"" \ ++ $STARTER_MAIN_CLASS \ ++ --main $CLASS \ ++ --conf "\"\$GROOVY_CONF\"" \ ++ --classpath "\"\$CP\"" \ ++ "\"\$@\"" ++ fi + fi + } + +-- +2.33.0 + diff --git a/groovy.spec b/groovy.spec index e832943..4557691 100644 --- a/groovy.spec +++ b/groovy.spec @@ -1,6 +1,6 @@ Name: groovy Version: 2.4.8 -Release: 10 +Release: 11 Summary: Dynamic language for the Java Platform License: ASL 2.0 and BSD and EPL-1.0 and Public Domain and ANTLR-PD and MIT URL: http://groovy-lang.org @@ -19,6 +19,7 @@ Patch5: 0006-Disable-artifactory-publish.patch Patch6: 0007-Fix-missing-extension-definitions.patch Patch7: CVE-2020-17521.patch Patch8: Speed-up-class-loading-of-groovy-all-files.patch +Patch9: 0008-compatible-for-version-1.8.patch BuildRequires: gradle-local >= 2.1-0.9 javapackages-local java-devel >= 1.8 ant antlr-tool ant-antlr BuildRequires: aqute-bnd gpars multiverse apache-parent testng jline apache-commons-cli apache-commons-beanutils @@ -191,6 +192,9 @@ EOF %doc LICENSE NOTICE README.adoc %changelog +* Tue Feb 20 2024 Ge Wang - 2.4.8-11 +- Compatible adapter for version 1.8 + * Mon Aug 09 2021 lingsheng - 2.4.8-10 - Speed up class loading of groovy-all files -- Gitee