grub-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] suppress error message "/grub2/locale/en.mo.gz not found"


From: Michael Chang
Subject: Re: [PATCH] suppress error message "/grub2/locale/en.mo.gz not found"
Date: Tue, 25 Sep 2012 12:46:15 +0800

2012/9/25 Andrey Borzenkov <address@hidden>:
> В Пн., 24/09/2012 в 11:37 +0200, Mads Kiilerich пишет:
>> On 09/24/2012 08:51 AM, Michael Chang wrote:
>> > We don't insert gettext module if message catalog file missing to
>> > prevent error message from being logged.
>> >
>> > Signed-off-by: Michael Chang <address@hidden>
>> > ---
>> >   util/grub.d/00_header.in |   10 +++++++---
>> >   1 files changed, 7 insertions(+), 3 deletions(-)
>> >
>> > diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in
>> > index bb34ef2..d438d52 100644
>> > --- a/util/grub.d/00_header.in
>> > +++ b/util/grub.d/00_header.in
>> > @@ -182,10 +182,14 @@ EOF
>> >
>> >   # Gettext variables and module
>> >   if [ "x${LANG}" != "xC" ] ; then
>>
>> Couldn't / sholdn't this check be replaced by the new check you introduce?
>>
>> > +# We don't insert gettext module if message catalog file missing
>> > +# To prevent error message from being logged (bnc#771393)
>>
>> That seems like a reference to some (internal Suse?) bugtracker? To me
>> it is https://bugzilla.redhat.com/show_bug.cgi?id=817187 , but I guess
>> https://savannah.gnu.org/bugs/?35880 is the best reference.
>>
>> >     cat << EOF
>> > -  set locale_dir=\$prefix/locale
>> > -  set lang=${grub_lang}
>> > -  insmod gettext
>> > +  if [ -f "\$prefix/locale/${grub_lang}.mo" ] ; then
>> > +    set locale_dir=\$prefix/locale
>> > +    set lang=${grub_lang}
>> > +    insmod gettext
>> > +  fi
>> >   EOF
>> >   fi
>>
>> I'm +1 for the principle, but does it really work for real world locales
>> like de_DE which will use de.mo on runtime?
>>
>
> No. It does not, except for zh_CN and zh_TW.
>
>> I would guess that it also should handle all the logic in gettext.c
>> grub_gettext_init_ext() and grub_mofile_open_lang() and how these
>> functions are invoked: .gz extension, _CC stripping and
>> primary/secondary locale_dir.
>>
>
> What about removing this error message altogether? Under OS gettext does
> not complaint when catalog does not exist; why should it do it here?
> Having English interface is enough indication that message catalog was
> not found.

I agree with you. IMHO the problem is it's not emitted directly from
gettext module but from common underlying fs level, removing it would
lead to other message which is fatal be ignored as well.

Another question is : Is there any other good method offered by grub2
to check the files existence that we could test before calling
grub_file_open() in gettext.c ? Anybody has good idea on this ?

Thanks,
Michael

>
> -andrey
>
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]