[virt-tools-list] [virt-what PATCH v2] Remove bashisms

Darren Kenny darren.kenny at oracle.com
Mon Sep 11 09:57:55 UTC 2017


Hi Guido,

This looks OK to me, as the original submitter of the change. Also have 
verified that it works on the Linux/SPARC system that I have. I didn't 
realise that we should be avoiding the ksh/bash [[ ]] variant.

For the record:

Reviewed-By: Darren Kenny <darren.kenny at oracle.com>

Thanks,

Darren.

Guido Günther wrote:
> Hi,
> On Tue, Aug 22, 2017 at 08:47:55PM +0200, Guido Günther wrote:
>> Hi,
>>
>> Ping?
>>   -- Guido
>
> Ping? It already had a review by Eric.
>   -- Guido
>
>> On Fri, Aug 04, 2017 at 12:02:08PM -0300, Guido Günther wrote:
>>> 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
>>> ---
>>> Updated with Eric's review comments addressed.
>>>
>>>   virt-what.in | 12 ++++++------
>>>   1 file changed, 6 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/virt-what.in b/virt-what.in
>>> index 8c27b11..1c04bcc 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.13.2
>>>
>>> _______________________________________________
>>> virt-tools-list mailing list
>>> virt-tools-list at redhat.com
>>> https://www.redhat.com/mailman/listinfo/virt-tools-list
>>>
>> _______________________________________________
>> virt-tools-list mailing list
>> virt-tools-list at redhat.com
>> https://www.redhat.com/mailman/listinfo/virt-tools-list
>>
>
> _______________________________________________
> virt-tools-list mailing list
> virt-tools-list at redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list




More information about the virt-tools-list mailing list