!51 [sync] PR-40: Recognize parameter separator for grape define command

From: @openeuler-sync-bot 
Reviewed-by: @cherry530 
Signed-off-by: @cherry530
This commit is contained in:
openeuler-ci-bot 2024-05-28 03:26:07 +00:00 committed by Gitee
commit b4ea0278cc
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 44 additions and 1 deletions

View File

@ -0,0 +1,39 @@
From 696538030dcf6ba670cb1dd8f9d762d860aac01c Mon Sep 17 00:00:00 2001
From: wang--ge <wang__ge@126.com>
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

View File

@ -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 <wang__ge@126.com> - 2.4.8-13
- Add parameter check for grape define
* Tue Feb 20 2024 Ge Wang <wang__ge@126.com> - 2.4.8-12
- Compatible adapter for version 1.8