aboutsummaryrefslogtreecommitdiffstats
path: root/community/virt-what/0002-Remove-bashisms.patch
blob: 02fe382e2aa94e0dafe5c34e985b25ae0d093ff0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
From 9d90704a05dee7704470eff818a1c44aeef6c880 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org>
Date: Fri, 4 Aug 2017 12:02:08 -0300
Subject: [PATCH] Remove bashisms

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 | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/virt-what.in b/virt-what.in
index 9050035..a05e0db 100644
--- a/virt-what.in
+++ b/virt-what.in
@@ -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
-- 
2.15.0