You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ds...@apache.org on 2016/04/16 04:08:04 UTC

lucene-solr:branch_6x: 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_6x 9bcdb4724 -> e1a5665fe


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/e1a5665f
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/e1a5665f
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/e1a5665f

Branch: refs/heads/branch_6x
Commit: e1a5665feeafd6cd891edff392e885aef648dbf5
Parents: 9bcdb47
Author: David Smiley <ds...@apache.org>
Authored: Fri Apr 15 22:06:54 2016 -0400
Committer: David Smiley <ds...@apache.org>
Committed: Fri Apr 15 22:07:58 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/e1a5665f/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 72bbccc..5b30775 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -87,6 +87,8 @@ Bug Fixes
 
 * SOLR-7729: ConcurrentUpdateSolrClient ignores the collection parameter in some methods.
   (Nicolas Gavalda, Jorge Luis Betancourt Gonzalez via Mark Miller)
+
+* SOLR-8946: bin/post failed to detect stdin usage on Ubuntu; maybe other unixes. (David Smiley)
   
 Optimizations
 ----------------------

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e1a5665f/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