Remove bashisms
authorGuido Günther <agx@sigxcpu.org>
Fri, 4 Aug 2017 15:02:08 +0000 (12:02 -0300)
committerRichard W.M. Jones <rjones@redhat.com>
Thu, 28 Sep 2017 12:31:39 +0000 (13:31 +0100)
Use [ instead of [[ so we fall back to test if necessary:

     http://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html

Gbp-Pq: Name Remove-bashisms.patch

virt-what.in

index 9050035..a05e0db 100644 (file)
@@ -360,20 +360,20 @@ if [ "$cpuid" = "OpenBSDVMM58" ]; then
 fi
 
 # Check for LDoms
-if [[ "$arch" == sparc* && -e ${root}/dev/mdesc ]]; then
+if [ "${arch#sparc}" != "$arch" ] && [ -e "${root}/dev/mdesc" ]; then
     echo ldoms
-    if [[ -d ${root}/sys/class/vlds/ctrl && \
-             -d ${root}/sys/class/vlds/sp ]]; then
+    if [ -d "${root}/sys/class/vlds/ctrl" ] && \
+             [ -d "${root}/sys/class/vlds/sp" ]; then
         echo ldoms-control
     else
         echo ldoms-guest
     fi
     MDPROP="${root}/usr/lib/ldoms/mdprop.py"
-    if [[ -x ${MDPROP} ]]; then
-        if [[ -n $($MDPROP -v iodevice device-type=pciex) ]]; then
+    if [ -x "${MDPROP}" ]; then
+        if [ -n "$($MDPROP -v iodevice device-type=pciex)" ]; then
             echo ldoms-root
             echo ldoms-io
-        elif [[ -n $($MDPROP -v iov-device vf-id=0) ]]; then
+        elif [ -n "$($MDPROP -v iov-device vf-id=0)" ]; then
             echo ldoms-io
         fi
     fi