Merge "Switch to using test -n"

This commit is contained in:
Jenkins
2015-06-01 23:18:20 +00:00
committed by Gerrit Code Review
3 changed files with 4 additions and 4 deletions

View File

@@ -177,7 +177,7 @@ EOF
# in the commit msg.
change_info=`ssh -p 29418 proposal-bot@review.openstack.org gerrit query --current-patch-set status:open project:$FULL_PROJECT topic:transifex/translations owner:proposal-bot`
previous=`echo "$change_info" | grep "^ number:" | awk '{print $2}'`
if [ "x${previous}" != "x" ] ; then
if [ -n "$previous" ]; then
change_id=`echo "$change_info" | grep "^change" | awk '{print $2}'`
# Read returns a non zero value when it reaches EOF. Because we use a
# heredoc here it will always reach EOF and return a nonzero value.
@@ -197,7 +197,7 @@ EOF
# update it will always get sniped out of the gate by another.
# It also helps, when you approve close to the time this job is
# run.
if [ "x${previous}" != "x" ] ; then
if [ -n "$previous" ]; then
# Use the JSON format since it is very compact and easy to grep
change_info=`ssh -p 29418 proposal-bot@review.openstack.org gerrit query --current-patch-set --format=JSON $change_id`
# Check for:

View File

@@ -73,7 +73,7 @@ for PROJECT in $(cat projects.txt); do
# commit msg.
change_info=$(ssh -p 29418 $USERNAME@review.openstack.org gerrit query --current-patch-set status:open project:$PROJECT topic:$TOPIC owner:$USERNAME branch:$BRANCH)
previous=$(echo "$change_info" | grep "^ number:" | awk '{print $2}')
if [ "x${previous}" != "x" ] ; then
if [ -n "$previous" ]; then
change_id=$(echo "$change_info" | grep "^change" | awk '{print $2}')
# read return a non zero value when it reaches EOF. Because we use a
# heredoc here it will always reach EOF and return a nonzero value.

View File

@@ -28,7 +28,7 @@ change_id=""
# commit msg.
change_info=$(ssh -p 29418 $USERNAME@review.openstack.org gerrit query --current-patch-set status:open project:$PROJECT topic:$TOPIC owner:$USERNAME)
previous=$(echo "$change_info" | grep "^ number:" | awk '{print $2}')
if [ "x${previous}" != "x" ] ; then
if [ -n "$previous" ]; then
change_id=$(echo "$change_info" | grep "^change" | awk '{print $2}')
# read return a non zero value when it reaches EOF. Because we use a
# heredoc here it will always reach EOF and return a nonzero value.