Skip to contentSkip to conversation

runqemu-internal: Fixes unary operator expected in new TCPSERIAL_PORTNUM

PATCH In review Aníbal Limón 3 participants 4 messages Aug 26, 2015 – Aug 27, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 runqemu-internal: Fixes unary operator expected in new TCPSERIAL_PORTNUM

If $TCPSERIAL_PORTNUM is empty string causes an error because expands the expresion to,

$TCPSERIAL_PORTNUM == "" -> == ""

---
 scripts/runqemu-internal | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/runqemu-internal +1 -1
index b317358..1b1bc9e 100755
@@ -620,7 +620,7 @@ if [ "x$QEMUOPTIONS" = "x" ]; then
     return 1
 fi
 
-if [ $TCPSERIAL_PORTNUM != "" ]; then
+if [ "$TCPSERIAL_PORTNUM" != "" ]; then
     if [ "$MACHINE" = "qemuarm64" ]; then
         QEMUOPTIONS="$QEMUOPTIONS -device virtio-serial-device -chardev socket,id=virtcon,port=$TCPSERIAL_PORTNUM,host=127.0.0.1 -device virtconsole,chardev=virtcon"
     else
Signature · 1 line
1.9.1
#1 lore raw
Quoted 15 lines · Aníbal Limón

If $TCPSERIAL_PORTNUM is empty string causes an error because expands the expresion to,

$TCPSERIAL_PORTNUM == "" -> == ""

---
 scripts/runqemu-internal | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/runqemu-internal +0 -0
index b317358..1b1bc9e 100755

scripts/runqemu-internal if [ "x$QEMUOPTIONS" = "x" ]; then · line 623

Quoted 5 lines
scripts/runqemu-internal +1 -1
@@ -620,7 +620,7 @@ if [ "x$QEMUOPTIONS" = "x" ]; then
     return 1
 fi
 
-if [ $TCPSERIAL_PORTNUM != "" ]; then
+if [ "$TCPSERIAL_PORTNUM" != "" ]; then

I believe this would work but if you want to make it bulletproof you'd:
if [ X"$TCPSERIAL_PORTNUM" != X"" ]; then

Quoted 8 lines
scripts/runqemu-internal +0 -2
     if [ "$MACHINE" = "qemuarm64" ]; then
         QEMUOPTIONS="$QEMUOPTIONS -device virtio-serial-device 
-chardev socket,id=virtcon,port=$TCPSERIAL_PORTNUM,host=127.0.0.1 
-device virtconsole,chardev=virtcon"
     else
Signature · 1 line
1.9.1
#2 lore raw
In reply to Aníbal Limón

ping

Quoted 23 lines · Aníbal Limón

If $TCPSERIAL_PORTNUM is empty string causes an error because expands the expresion to,

$TCPSERIAL_PORTNUM == "" -> == ""

---
  scripts/runqemu-internal | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
scripts/runqemu-internal +1 -1
index b317358..1b1bc9e 100755
@@ -620,7 +620,7 @@ if [ "x$QEMUOPTIONS" = "x" ]; then
      return 1
  fi
 
-if [ $TCPSERIAL_PORTNUM != "" ]; then
+if [ "$TCPSERIAL_PORTNUM" != "" ]; then
      if [ "$MACHINE" = "qemuarm64" ]; then
          QEMUOPTIONS="$QEMUOPTIONS -device virtio-serial-device -chardev socket,id=virtcon,port=$TCPSERIAL_PORTNUM,host=127.0.0.1 -device virtconsole,chardev=virtcon"
      else
#3 lore raw
Quoted 2 lines · Aníbal Limón

ping

It's in the queue - ross/mut is *giant* at this point but I just want to see master pass once with all green...

Ross