You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sa...@apache.org on 2016/05/20 12:41:10 UTC

lucene-solr:branch_6_0: SOLR-8946: fix bin/post stdin detection. faulty on Ubuntu; maybe others (cherry picked from commit 7833f7f)

Repository: lucene-solr
Updated Branches:
  refs/heads/branch_6_0 a2732fd6f -> b119ad60a


SOLR-8946: fix bin/post stdin detection. faulty on Ubuntu; maybe others
(cherry picked from commit 7833f7f)


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

Branch: refs/heads/branch_6_0
Commit: b119ad60a1d0a58ae4e7a6be54dc3b119bd484b0
Parents: a2732fd
Author: David Smiley <ds...@apache.org>
Authored: Fri Apr 15 22:06:54 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Fri May 20 08:40:25 2016 -0400

----------------------------------------------------------------------
 solr/CHANGES.txt | 2 ++
 solr/bin/post    | 9 ++++-----
 2 files changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b119ad60/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index dfa1fe8..8361d9a 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -46,6 +46,8 @@ Bug Fixes
 * SOLR-8875: SolrCloud Overseer clusterState could unexpectedly be null resulting in NPE.
   (Scott Blum via David Smiley)
 
+* SOLR-8946: bin/post failed to detect stdin usage on Ubuntu; maybe other unixes. (David Smiley)
+
 Other Changes
 ----------------------
 * SOLR-7516: Improve javadocs for JavaBinCodec, ObjectResolver and enforce the single-usage policy.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b119ad60/solr/bin/post
----------------------------------------------------------------------
diff --git a/solr/bin/post b/solr/bin/post
index 92172ab..73e59ed 100755
--- a/solr/bin/post
+++ b/solr/bin/post
@@ -140,7 +140,7 @@ while [ $# -gt 0 ]; do
         shift
         PROPS+=("-Dport=$1")
       elif [[ ("$1" == "-d" || "$1" == "--data" || "$1" == "-") ]]; then
-        if [[ -s /dev/stdin ]]; then
+        if [[ ! -t 0 ]]; then
           MODE="stdin"
         else
           # when no stdin exists and -d specified, the rest of the arguments
@@ -150,6 +150,9 @@ while [ $# -gt 0 ]; do
           if [[ $# -gt 0 ]]; then
             ARGS=("$@")
             shift $#
+          else
+            # SPT needs a valid args string, useful for 'bin/post -c foo -d' to force a commit
+            ARGS+=("<add/>")
           fi
         fi
       else
@@ -209,10 +212,6 @@ if [[ $MODE != "stdin" && $MODE != "args" ]]; then
     PARAMS=("${URLS[@]}")
   fi
 else
-  if [[ ${#ARGS[@]} == 0 ]]; then
-    # SPT needs a valid (to post to Solr) args string, useful for 'bin/post -c foo -d' to force a commit
-    ARGS+=("<add/>")
-  fi
   PARAMS=("${ARGS[@]}")
 fi