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/06/17 20:16:39 UTC
[1/2] lucene-solr:branch_5_5: 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_5_5 83bd4fc00 -> 060902366
refs/heads/branch_5x 5d5719877 -> 0b4a81eaa
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/06090236
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/06090236
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/06090236
Branch: refs/heads/branch_5_5
Commit: 060902366027239832f532db4250f0d337c1cb96
Parents: 83bd4fc
Author: David Smiley <ds...@apache.org>
Authored: Fri Apr 15 22:06:54 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Fri Jun 17 16:15:54 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/06090236/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 7130105..4bdcbff 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)
+
======================= 5.5.1 =======================
Bug Fixes
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/06090236/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
[2/2] lucene-solr:branch_5x: SOLR-8946: fix bin/post stdin detection.
faulty on Ubuntu; maybe others (cherry picked from commit 7833f7f)
Posted by sa...@apache.org.
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/0b4a81ea
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/0b4a81ea
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/0b4a81ea
Branch: refs/heads/branch_5x
Commit: 0b4a81eaae07a9e271c74f59f586075d3ee00ca1
Parents: 5d57198
Author: David Smiley <ds...@apache.org>
Authored: Fri Apr 15 22:06:54 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Fri Jun 17 16:16:28 2016 -0400
----------------------------------------------------------------------
solr/bin/post | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0b4a81ea/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