mirror of https://github.com/apache/lucene.git
SOLR-8946: fix bin/post stdin detection. faulty on Ubuntu; maybe others
(cherry picked from commit 7833f7f
)
This commit is contained in:
parent
9bcdb4724c
commit
e1a5665fee
|
@ -87,6 +87,8 @@ Bug Fixes
|
||||||
|
|
||||||
* SOLR-7729: ConcurrentUpdateSolrClient ignores the collection parameter in some methods.
|
* SOLR-7729: ConcurrentUpdateSolrClient ignores the collection parameter in some methods.
|
||||||
(Nicolas Gavalda, Jorge Luis Betancourt Gonzalez via Mark Miller)
|
(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
|
Optimizations
|
||||||
----------------------
|
----------------------
|
||||||
|
|
|
@ -140,7 +140,7 @@ while [ $# -gt 0 ]; do
|
||||||
shift
|
shift
|
||||||
PROPS+=("-Dport=$1")
|
PROPS+=("-Dport=$1")
|
||||||
elif [[ ("$1" == "-d" || "$1" == "--data" || "$1" == "-") ]]; then
|
elif [[ ("$1" == "-d" || "$1" == "--data" || "$1" == "-") ]]; then
|
||||||
if [[ -s /dev/stdin ]]; then
|
if [[ ! -t 0 ]]; then
|
||||||
MODE="stdin"
|
MODE="stdin"
|
||||||
else
|
else
|
||||||
# when no stdin exists and -d specified, the rest of the arguments
|
# when no stdin exists and -d specified, the rest of the arguments
|
||||||
|
@ -150,6 +150,9 @@ while [ $# -gt 0 ]; do
|
||||||
if [[ $# -gt 0 ]]; then
|
if [[ $# -gt 0 ]]; then
|
||||||
ARGS=("$@")
|
ARGS=("$@")
|
||||||
shift $#
|
shift $#
|
||||||
|
else
|
||||||
|
# SPT needs a valid args string, useful for 'bin/post -c foo -d' to force a commit
|
||||||
|
ARGS+=("<add/>")
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
@ -209,10 +212,6 @@ if [[ $MODE != "stdin" && $MODE != "args" ]]; then
|
||||||
PARAMS=("${URLS[@]}")
|
PARAMS=("${URLS[@]}")
|
||||||
fi
|
fi
|
||||||
else
|
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[@]}")
|
PARAMS=("${ARGS[@]}")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue