lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject lucene-solr:branch_6x: SOLR-9760: solr.cmd doesn't need write permission in current directory
Date Tue, 20 Dec 2016 21:44:02 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/branch_6x 21a6fc3d7 -> b45293313


SOLR-9760: solr.cmd doesn't need write permission in current directory


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/b4529331
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/b4529331
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/b4529331

Branch: refs/heads/branch_6x
Commit: b45293313be52127841dc01e84bcd66909d305aa
Parents: 21a6fc3
Author: Mikhail Khludnev <mkhl@apache.org>
Authored: Wed Dec 21 00:40:56 2016 +0300
Committer: Mikhail Khludnev <mkhl@apache.org>
Committed: Wed Dec 21 00:43:27 2016 +0300

----------------------------------------------------------------------
 solr/CHANGES.txt  |  2 ++
 solr/bin/solr.cmd | 15 +++------------
 2 files changed, 5 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b4529331/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 8cadb1b..9b58f8b 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -203,6 +203,8 @@ Bug Fixes
   This reduces the likelihood of a (time-limited) distributed deadlock during concurrent
schema updates.
   (Mark Miller, Steve Rowe)
 
+* SOLR-9760: Windows script doesn't need write permission (Alex Crome by Mikhail Khludnev)
+
 Other Changes
 ----------------------
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b4529331/solr/bin/solr.cmd
----------------------------------------------------------------------
diff --git a/solr/bin/solr.cmd b/solr/bin/solr.cmd
index 5033106..72d42d7 100644
--- a/solr/bin/solr.cmd
+++ b/solr/bin/solr.cmd
@@ -1627,11 +1627,7 @@ set JAVA_MAJOR_VERSION=0
 set JAVA_VERSION_INFO=
 set JAVA_BUILD=0
 
-"%JAVA%" -version 2>&1 | findstr /i "version" > javavers
-set /p JAVAVEROUT=<javavers
-del javavers
-
-for /f "tokens=3" %%a in ("!JAVAVEROUT!") do (
+FOR /f "usebackq tokens=3" %%a IN (`^""%JAVA%" -version 2^>^&1 ^| findstr "version"^"`)
do (
   set JAVA_VERSION_INFO=%%a
   REM Remove surrounding quotes
   set JAVA_VERSION_INFO=!JAVA_VERSION_INFO:"=!
@@ -1652,13 +1648,8 @@ GOTO :eof
 
 REM Set which JVM vendor we have
 :resolve_java_vendor
-set "JAVA_VENDOR=Oracle"
-"%JAVA%" -version 2>&1 | findstr /i "IBM J9" > javares
-set /p JAVA_VENDOR_OUT=<javares
-del javares
-if NOT "%JAVA_VENDOR_OUT%" == "" (
-  set "JAVA_VENDOR=IBM J9"
-)
+"%JAVA%" -version 2>&1 | findstr /i "IBM J9" > nul
+if %ERRORLEVEL% == 1 ( set "JAVA_VENDOR=Oracle" ) else ( set "JAVA_VENDOR=IBM J9" )
 
 set JAVA_VENDOR_OUT=
 GOTO :eof


Mime
View raw message