Skip to contentSkip to conversation

scripts/qemu-binfmt-conf.sh: Fix shell portability issue

PATCH Applied Kamil Rytarowski 5 participants 6 messages Apr 25, 2017 – May 5, 2017 exec and binfmt

lore
Share & tools
lore
Reviewed-by on v1 1/1
#1 lore raw
In reply to Kamil Rytarowski
Quoted 5 lines · Kamil Rytarowski

Appease pkgsrc and use portable shell variable comparison. This switches "==" to "=". It should not be a functional change.

---

Thanks for this patch; it's an easy bug to let slip in if your /bin/sh happens to be bash.

PS: you forgot to cc qemu-devel@ on this patch.

Quoted 23 lines
 scripts/qemu-binfmt-conf.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/qemu-binfmt-conf.sh +2 -3
index 0f1aa63872..8afc3eb5bb 100755
@@ -284,12 +284,12 @@ while true ; do
         shift
         # check given cpu is in the supported CPU list
         for cpu in ${qemu_target_list} ; do
-            if [ "$cpu" == "$1" ] ; then
+            if [ "$cpu" = "$1" ] ; then
                 break
             fi
         done
 
-        if [ "$cpu" == "$1" ] ; then
+        if [ "$cpu" = "$1" ] ; then
             qemu_target_list="$1"
         else
             echo "ERROR: unknown CPU \"$1\"" 1>&2
--
Quoted 1 line

2.12.2

thanks
-- PMM

#2 lore raw
Quoted 4 lines · Peter Maydell
Quoted 3 lines · Kamil Rytarowski

Appease pkgsrc and use portable shell variable comparison. This switches "==" to "=". It should not be a functional change.

Quoted 8 lines
Quoted 2 lines

---

Thanks for this patch; it's an easy bug to let slip in if your /bin/sh happens to be bash.

PS: you forgot to cc qemu-devel@ on this patch.

I assumed that qemu-trivial@ don't need to go to qemu-devel@. Thank you for pointing it out.

Quoted 30 lines
Quoted 23 lines
 scripts/qemu-binfmt-conf.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/qemu-binfmt-conf.sh +2 -3
index 0f1aa63872..8afc3eb5bb 100755
@@ -284,12 +284,12 @@ while true ; do
         shift
         # check given cpu is in the supported CPU list
         for cpu in ${qemu_target_list} ; do
-            if [ "$cpu" == "$1" ] ; then
+            if [ "$cpu" = "$1" ] ; then
                 break
             fi
         done
 
-        if [ "$cpu" == "$1" ] ; then
+        if [ "$cpu" = "$1" ] ; then
             qemu_target_list="$1"
         else
             echo "ERROR: unknown CPU \"$1\"" 1>&2
--
Quoted 1 line

2.12.2

thanks
-- PMM

#3 lore raw
Quoted 8 lines · Kamil Rytarowski
Quoted 7 lines · Peter Maydell
Quoted 5 lines · Kamil Rytarowski

Appease pkgsrc and use portable shell variable comparison. This switches "==" to "=". It should not be a functional change.

---

Quoted 8 lines
Quoted 5 lines

Thanks for this patch; it's an easy bug to let slip in if your /bin/sh happens to be bash.

PS: you forgot to cc qemu-devel@ on this patch.

I assumed that qemu-trivial@ don't need to go to qemu-devel@. Thank you for pointing it out.

ALL patches need to go to qemu-devel (so we have a one-stop-shop for all pending patches), but some patches need to additionally go to secondary lists for catching the attention of the right maintainers.

scripts/get_maintainer.pl is your friend, and it should always list qemu-devel in its answer.

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org
Reviewed-by
#4 lore raw
In reply to Peter Maydell
Quoted 29 lines · Peter Maydell
Quoted 5 lines · Kamil Rytarowski

Appease pkgsrc and use portable shell variable comparison. This switches "==" to "=". It should not be a functional change.

---

Thanks for this patch; it's an easy bug to let slip in if your /bin/sh happens to be bash.

PS: you forgot to cc qemu-devel@ on this patch.

Quoted 17 lines
 scripts/qemu-binfmt-conf.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/qemu-binfmt-conf.sh +1 -1
index 0f1aa63872..8afc3eb5bb 100755
@@ -284,12 +284,12 @@ while true ; do
         shift
         # check given cpu is in the supported CPU list
         for cpu in ${qemu_target_list} ; do
-            if [ "$cpu" == "$1" ] ; then
+            if [ "$cpu" = "$1" ] ; then
                 break
             fi
         done
 
Quoted 9 lines
Quoted 7 lines
scripts/qemu-binfmt-conf.sh +1 -2
-        if [ "$cpu" == "$1" ] ; then
+        if [ "$cpu" = "$1" ] ; then
             qemu_target_list="$1"
         else
             echo "ERROR: unknown CPU \"$1\"" 1>&2
--

2.12.2

#0 lore raw

PATCH 1/1 scripts/qemu-binfmt-conf.sh: Fix shell portability issue

Appease pkgsrc and use portable shell variable comparison. This switches "==" to "=". It should not be a functional change.

---
 scripts/qemu-binfmt-conf.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/qemu-binfmt-conf.sh +2 -2
index 0f1aa63872..8afc3eb5bb 100755
@@ -284,12 +284,12 @@ while true ; do
         shift
         # check given cpu is in the supported CPU list
         for cpu in ${qemu_target_list} ; do
-            if [ "$cpu" == "$1" ] ; then
+            if [ "$cpu" = "$1" ] ; then
                 break
             fi
         done
 
-        if [ "$cpu" == "$1" ] ; then
+        if [ "$cpu" = "$1" ] ; then
             qemu_target_list="$1"
         else
             echo "ERROR: unknown CPU \"$1\"" 1>&2
Signature · 1 line
2.12.2
#5 lore raw
Quoted 2 lines · Kamil Rytarowski

Appease pkgsrc and use portable shell variable comparison. This switches "==" to "=". It should not be a functional change.

Applied to -trivial, thanks!

/mjt

Quoted 25 lines
---
 scripts/qemu-binfmt-conf.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/qemu-binfmt-conf.sh +2 -2
index 0f1aa63872..8afc3eb5bb 100755
@@ -284,12 +284,12 @@ while true ; do
         shift
         # check given cpu is in the supported CPU list
         for cpu in ${qemu_target_list} ; do
-            if [ "$cpu" == "$1" ] ; then
+            if [ "$cpu" = "$1" ] ; then
                 break
             fi
         done
 
-        if [ "$cpu" == "$1" ] ; then
+        if [ "$cpu" = "$1" ] ; then
             qemu_target_list="$1"
         else
             echo "ERROR: unknown CPU \"$1\"" 1>&2