mirror of
https://github.com/elastic/logstash.git
synced 2025-04-20 12:47:23 -04:00
A recent change to pqheck, attempted to address an issue where the
pqcheck would not on Windows mahcines when located in a folder containing
a space, such as "C:\program files\elastic\logstash". While this fixed an
issue with spaces in folders, it introduced a new issue related to Java options,
and the pqcheck was still unable to run on Windows.
This PR attempts to address the issue, by removing the quotes around the Java options,
which caused the option parsing to fail, and instead removes the explicit setting of
the classpath - the use of `set CLASSPATH=` in the `:concat` function is sufficient
to set the classpath, and should also fix the spaces issue
Fixes: #17209
(cherry picked from commit ba5f21576c
)
Co-authored-by: Rob Bavey <rob.bavey@elastic.co>
29 lines
463 B
Batchfile
29 lines
463 B
Batchfile
@echo off
|
|
setlocal enabledelayedexpansion
|
|
|
|
call "%~dp0setup.bat" || exit /b 1
|
|
if errorlevel 1 (
|
|
if not defined nopauseonerror (
|
|
pause
|
|
)
|
|
exit /B %ERRORLEVEL%
|
|
)
|
|
|
|
|
|
set JAVA_OPTS=%LS_JAVA_OPTS%
|
|
|
|
for %%i in ("%LS_HOME%\logstash-core\lib\jars\*.jar") do (
|
|
call :concat "%%i"
|
|
)
|
|
|
|
"%JAVACMD%" %JAVA_OPTS% org.logstash.ackedqueue.PqRepair %*
|
|
|
|
:concat
|
|
IF not defined CLASSPATH (
|
|
set CLASSPATH="%~1"
|
|
) ELSE (
|
|
set CLASSPATH=%CLASSPATH%;"%~1"
|
|
)
|
|
goto :eof
|
|
|
|
endlocal
|