From f0acc3954f886eb09dfa70cbebdac0a6ea71b9b9 Mon Sep 17 00:00:00 2001 From: Christos Malliaridis Date: Sat, 14 Dec 2024 17:04:55 +0100 Subject: [PATCH 1/3] Fix argument parsing for -D options with multiple values on Windows --- solr/bin/solr.cmd | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/solr/bin/solr.cmd b/solr/bin/solr.cmd index 1dca1a9e81c..b1a3647f6a6 100755 --- a/solr/bin/solr.cmd +++ b/solr/bin/solr.cmd @@ -643,15 +643,36 @@ SHIFT goto parse_args :set_passthru -set "PASSTHRU=%~1=%~2" +set "PASSTHRU_KEY=%~1" +set "PASSTHRU_VALUES=" + +SHIFT +:repeat_passthru +set "arg=%~1" +if "%arg%"=="" goto end_passthru +set firstChar=%arg:~0,1% +IF "%firstChar%"=="-" ( + goto end_passthru +) + +if defined PASSTHRU_VALUES ( + set "PASSTHRU_VALUES=%PASSTHRU_VALUES%,%arg%" +) else ( + set "PASSTHRU_VALUES=%arg%" +) +SHIFT +goto repeat_passthru + +:end_passthru +set "PASSTHRU=%PASSTHRU_KEY%=%PASSTHRU_VALUES%" + IF NOT "%SOLR_OPTS%"=="" ( set "SOLR_OPTS=%SOLR_OPTS% %PASSTHRU%" ) ELSE ( set "SOLR_OPTS=%PASSTHRU%" ) set "PASS_TO_RUN_EXAMPLE=%PASSTHRU% !PASS_TO_RUN_EXAMPLE!" -SHIFT -SHIFT + goto parse_args :set_noprompt From b633a663b96da5b764a94a374651b421b4c31707 Mon Sep 17 00:00:00 2001 From: Christos Malliaridis Date: Sat, 14 Dec 2024 17:34:41 +0100 Subject: [PATCH 2/3] Fix invalid usage of wildcards in RunExampleTool / PostTool --- solr/core/src/java/org/apache/solr/cli/RunExampleTool.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/solr/core/src/java/org/apache/solr/cli/RunExampleTool.java b/solr/core/src/java/org/apache/solr/cli/RunExampleTool.java index 6d7b349911c..a3e1cc39f71 100644 --- a/solr/core/src/java/org/apache/solr/cli/RunExampleTool.java +++ b/solr/core/src/java/org/apache/solr/cli/RunExampleTool.java @@ -352,7 +352,9 @@ protected void runExample(CommandLine cli, String exampleName) throws Exception collectionName, "--type", "application/xml", - exampledocsDir.toAbsolutePath() + "/*.xml" + "--filetypes", + "xml", + exampledocsDir.toAbsolutePath().toString() }; PostTool postTool = new PostTool(); CommandLine postToolCli = SolrCLI.parseCmdLine(postTool, args); From 91dcd0de2a84fa9ed15dfde2bdf37f5944c5952e Mon Sep 17 00:00:00 2001 From: Christos Malliaridis Date: Sat, 14 Dec 2024 17:55:32 +0100 Subject: [PATCH 3/3] Include bugfixes in CHANGES.txt --- solr/CHANGES.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index a5f6c24d1d1..752c2670887 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -273,6 +273,9 @@ Bug Fixes * SOLR-17574: Fix AllowListUrlChecker when liveNodes changes. Remove ClusterState.getHostAllowList (Bruno Roustant, David Smiley) +* SOLR-17595: Fix two issues in Solr CLI that prevent Solr from starting with the techproducts example and from + correctly parsing arguments on Windows that start with -D and have multiple values separated by "," or spaces. (Christos Malliaridis) + Dependency Upgrades --------------------- (No changes)