[libvirt] [PATCH 1/2] libvirtd.init: improve portability

Eric Blake eblake at redhat.com
Wed Apr 14 16:32:14 UTC 2010

On 04/14/2010 10:24 AM, Jim Meyering wrote:
> Eric Blake wrote:
>> This patch kills translation of the daemon messages, but being a
>> daemon, the messages probably didn't need translation in the first
>> place.  Other alternatives would be to make the script require
>> * daemon/libvirtd.init.in (start, stop, reload): Drop bash-ism of
>> $"".  Use printf instead of echo -n.
> IMHO, converting "echo -n" to printf is the way to go,
> if for no other reason than to set a proper example.

But we're so heavily outnumbered by other scripts at the moment (that
is, I repeated your grep /etc/init.d/* test, and the only 2 hits for
printf were in awk subscripts), that the better thing to do here would
be to file a bug on the upstream template that the init scripts borrow
from, and get the template changed, rather than trying to brave it as
the odd-man-out example.

Daniel's argument that init scripts are only for Fedora, where we can
guarantee that #!/bin/sh _is_ bash and therefore supports both echo -n
and $"", is pretty convincing, so I'm discarding 1/2 from my queue.

Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 323 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20100414/256b85d6/attachment-0001.sig>

More information about the libvir-list mailing list