[Top][All Lists]
[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 11:49:50 +0800 |
2012/9/24 Mads Kiilerich <address@hidden>:
> 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?
Yes. It should be done in mkconfig, which is in general better than in
run-time. The problem is that I don't know how to get $prefix
environment grub2 set implicitly at runtime. (It seems to be retrieved
somewhere from grub module header but I can't tell in exact).
>
>
>> +# 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.
The bug is public report against openSUSE 12.2 :
https://bugzilla.novell.com/show_bug.cgi?id=771393
>
>
>> 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 doesn't. :(
>
> 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.
You're right. All logics in gettext.c should be considered and
implemented in the patch, otherwise it would cause regressions.
>
> (I would prefer if all this processing could be done in mkconfig instead of
> on runtime, but I guess the desire for backward compatibility prevents
> that.)
>
> (It also seems to me like the current system lacks support for fallback from
> address@hidden to ll_CC and ll. I don't know if that is a real
> problem.)
Thank you for your great review here, and please forgive my ignorant
not checking the gettext.c before working the patch. :)
Regards,
Michael
>
> /Mads
>
> _______________________________________________
> Grub-devel mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/grub-devel
>
- [PATCH] suppress error message "/grub2/locale/en.mo.gz not found", Michael Chang, 2012/09/24
- Re: [PATCH] suppress error message "/grub2/locale/en.mo.gz not found", Mads Kiilerich, 2012/09/24
- Re: [PATCH] suppress error message "/grub2/locale/en.mo.gz not found", Andrey Borzenkov, 2012/09/24
- Re: [PATCH] suppress error message "/grub2/locale/en.mo.gz not found", Michael Chang, 2012/09/25
- Re: [PATCH] suppress error message "/grub2/locale/en.mo.gz not found", Andrey Borzenkov, 2012/09/25
- Re: [PATCH] suppress error message "/grub2/locale/en.mo.gz not found", Andrey Borzenkov, 2012/09/25
- Re: [PATCH] suppress error message "/grub2/locale/en.mo.gz not found", Colin Watson, 2012/09/25
- Re: [PATCH] suppress error message "/grub2/locale/en.mo.gz not found", Michael Chang, 2012/09/26
- Re: [PATCH] suppress error message "/grub2/locale/en.mo.gz not found", Colin Watson, 2012/09/26
- Re: [PATCH] suppress error message "/grub2/locale/en.mo.gz not found",
Michael Chang <=
- Re: [PATCH] suppress error message "/grub2/locale/en.mo.gz not found", Colin Watson, 2012/09/25