diff --git a/0009-add-parameter-check-for-grape-define.patch b/0009-add-parameter-check-for-grape-define.patch new file mode 100644 index 0000000000000000000000000000000000000000..7b65e4d7b6f2a67863b3a8a52fd0d04d50bca60e --- /dev/null +++ b/0009-add-parameter-check-for-grape-define.patch @@ -0,0 +1,39 @@ +From 696538030dcf6ba670cb1dd8f9d762d860aac01c Mon Sep 17 00:00:00 2001 +From: wang--ge +Date: Thu, 14 Mar 2024 11:19:28 +0800 +Subject: [PATCH] asd + +--- + .../org/codehaus/groovy/tools/GrapeMain.groovy | 16 ++++++++++++---- + 1 file changed, 12 insertions(+), 4 deletions(-) + +diff --git a/src/main/org/codehaus/groovy/tools/GrapeMain.groovy b/src/main/org/codehaus/groovy/tools/GrapeMain.groovy +index 0a1843d..528e8ed 100644 +--- a/src/main/org/codehaus/groovy/tools/GrapeMain.groovy ++++ b/src/main/org/codehaus/groovy/tools/GrapeMain.groovy +@@ -348,10 +348,18 @@ if (cmd.hasOption('v')) { + return + } + +- +-cmd.getOptionValues('D')?.each {String prop -> +- def (k, v) = prop.split ('=', 2) as List // array multiple assignment quirk +- System.setProperty(k, v ?: "") ++if (cmd.hasOption('D')) { ++ cmd.getOptionValues('D')?.each {String prop -> ++ while (prop.startsWith("=")) { ++ prop = prop.substring(1, prop.length()); ++ } ++ def (k, v) = prop.split ('=', 2) as List // array multiple assignment quirk ++ if (k.isEmpty() || v.isEmpty()) { ++ println "one system property's name or value is emply, skip." ++ } else { ++ System.setProperty(k, v ?: "") ++ } ++ } + } + + String[] arg = cmd.args +-- +2.33.0 + diff --git a/groovy.spec b/groovy.spec index 7ba1d4064b729cdf2f4f76b21a33c8395c56cc67..bf622b743a0659a0ac166ff41763ca6ef230635f 100644 --- a/groovy.spec +++ b/groovy.spec @@ -1,6 +1,6 @@ Name: groovy Version: 2.4.8 -Release: 12 +Release: 13 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 @@ -20,6 +20,7 @@ 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 +Patch10: 0009-add-parameter-check-for-grape-define.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 @@ -192,6 +193,9 @@ EOF %doc LICENSE NOTICE README.adoc %changelog +* Wed Mar 13 2024 Ge Wang - 2.4.8-13 +- Add parameter check for grape define + * Tue Feb 20 2024 Ge Wang - 2.4.8-12 - Compatible adapter for version 1.8