Re: 1/3 testsuite formatting bugs [was: [PATCH] Skip some xen tests if xend is not running]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/09/2011 07:27 AM, Eric Blake wrote:
>>
>> Also seq isn't portable. Therefore, calculate the correct padding
>> length directly and use printf to output it at once.
>> ---
>>  tests/test-lib.sh |    9 ++-------
>>  1 files changed, 2 insertions(+), 7 deletions(-)
> 
> ACK.

On second thought, for the case where ($counter % 40 == 0), we want 40
spaces if $counter is 0, but 0 spaces if $counter is positive.  I think
we need a slight tweak.  Rather than:

+    len=`expr 40 - \( $counter % 40 \)`

how about:

if test $counter = 0; then
  len=40
else
  len=`expr 39 - \( \( $counter - 1 \) % 40 \)`
fi

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]