[libvirt] libvirt-guests output

Eric Blake eblake at redhat.com
Thu Dec 9 18:31:22 UTC 2010


On 12/09/2010 11:21 AM, Laurent Léonard wrote:
> Hi,
> 
> Here is an example of libvirt-guest output:
> $Running guests on default URI: test-vm
> $Suspending guests on default URI...
> $Suspending test-vm: $done
> 
> Why all the lines begin with "$" ?

Because you aren't using bash.

Bash supports $"" as a way to provide gettext translation of strings
into the user's preferred location.  Init scripts written for
Fedora-based systems assume that /bin/sh is bash, and therefore that $""
is usable.

Dash does not understand $"" (POSIX says it has unspecified behavior),
and treats it as a literal '$' followed by a normal (untranslated) "".

It's probably a nice goal to port libvirt-guests to non-bash /bin/sh,
but it may take a lot more work; in particular, there are TONS of
existing init scripts on Fedora that assume bash extensions, which
libvirt-guests used as its starting point.  And I'm not quite sure what
the POSIX-compliant replacement for $"" string translation would be.
There are two problems to solve - how to get xgettext to recognize a
string that needs translation, and how to use gettext(1) (rather than
bash's magic $"" automatically calling gettext(3)) to do the translation
at runtime.

-- 
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: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20101209/a1dae182/attachment-0001.sig>


More information about the libvir-list mailing list