a03d84
From 43e99a03335b803384e241935e9c03ac000920c0 Mon Sep 17 00:00:00 2001
445594
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org>
445594
Date: Fri, 4 Aug 2017 12:02:08 -0300
a03d84
Subject: [PATCH 2/8] Remove bashisms
445594
445594
Use [ instead of [[ so we fall back to test if necessary:
445594
445594
     http://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html
445594
445594
Gbp-Pq: Name Remove-bashisms.patch
445594
---
445594
 virt-what.in | 12 ++++++------
445594
 1 file changed, 6 insertions(+), 6 deletions(-)
445594
445594
diff --git a/virt-what.in b/virt-what.in
445594
index 9050035..a05e0db 100644
445594
--- a/virt-what.in
445594
+++ b/virt-what.in
445594
@@ -360,20 +360,20 @@ if [ "$cpuid" = "OpenBSDVMM58" ]; then
445594
 fi
445594
 
445594
 # Check for LDoms
445594
-if [[ "$arch" == sparc* && -e ${root}/dev/mdesc ]]; then
445594
+if [ "${arch#sparc}" != "$arch" ] && [ -e "${root}/dev/mdesc" ]; then
445594
     echo ldoms
445594
-    if [[ -d ${root}/sys/class/vlds/ctrl && \
445594
-             -d ${root}/sys/class/vlds/sp ]]; then
445594
+    if [ -d "${root}/sys/class/vlds/ctrl" ] && \
445594
+             [ -d "${root}/sys/class/vlds/sp" ]; then
445594
         echo ldoms-control
445594
     else
445594
         echo ldoms-guest
445594
     fi
445594
     MDPROP="${root}/usr/lib/ldoms/mdprop.py"
445594
-    if [[ -x ${MDPROP} ]]; then
445594
-        if [[ -n $($MDPROP -v iodevice device-type=pciex) ]]; then
445594
+    if [ -x "${MDPROP}" ]; then
445594
+        if [ -n "$($MDPROP -v iodevice device-type=pciex)" ]; then
445594
             echo ldoms-root
445594
             echo ldoms-io
445594
-        elif [[ -n $($MDPROP -v iov-device vf-id=0) ]]; then
445594
+        elif [ -n "$($MDPROP -v iov-device vf-id=0)" ]; then
445594
             echo ldoms-io
445594
         fi
445594
     fi
445594
-- 
a03d84
2.32.0
445594