From: Andrey Borzenkov <arvidjaar@gmail.com>
To: Michael Chang <mchang@suse.com>
Cc: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: [PATCH] suppress error message "/grub2/locale/en.mo.gz not found"
Date: Tue, 25 Sep 2012 22:52:24 +0400 [thread overview]
Message-ID: <1348599144.1760.2.camel@opensuse.site> (raw)
In-Reply-To: <1348586655.1610.3.camel@opensuse.site>
[-- Attachment #1: Type: text/plain, Size: 1638 bytes --]
В Вт., 25/09/2012 в 19:24 +0400, Andrey Borzenkov пишет:
> В Вт., 25/09/2012 в 12:46 +0800, Michael Chang пишет:
> > 2012/9/25 Andrey Borzenkov <arvidjaar@gmail.com>:
> > > В Пн., 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.
> [...]
> > >
> > > 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.
> >
>
> As far as I can tell it is emitted explicitly when setting "lang":
>
> grub-core/gettext/gettext.c:grub_gettext_env_write_lang()
>
> grub_err_t err;
> err = grub_gettext_init_ext (&main_context, val, grub_env_get
> ("locale_dir"),
> grub_env_get ("prefix"));
> if (err)
> grub_print_error ();
>
> and later. There are some more places which also try to reload catalog.
>
Attached is prototype patch (tested) which suppresses error return from
grub_text_init_ext(). Proper patch would need to also change function
prototype, as its return value is now useless.
> May be this messages can be turned into debugging message instead of
> error.
>
That I do not know how to do.
[-- Attachment #2: grub2-no-error-on-missing-message-catalog.patch --]
[-- Type: text/x-patch, Size: 639 bytes --]
Index: b/grub-core/gettext/gettext.c
===================================================================
--- a/grub-core/gettext/gettext.c
+++ b/grub-core/gettext/gettext.c
@@ -395,6 +395,9 @@ grub_gettext_init_ext (struct grub_gette
if (!part1 || part1[0] == 0)
return 0;
+ /* It is not an error if message catalog does not exist */
+ grub_error_push ();
+
err = grub_mofile_open_lang (ctx, part1, part2, locale);
/* ll_CC didn't work, so try ll. */
@@ -412,7 +415,9 @@ grub_gettext_init_ext (struct grub_gette
grub_free (lang);
}
- return err;
+
+ grub_error_pop ();
+ return 0;
}
static char *
next prev parent reply other threads:[~2012-09-25 18:52 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-24 6:51 [PATCH] suppress error message "/grub2/locale/en.mo.gz not found" Michael Chang
2012-09-24 9:37 ` Mads Kiilerich
2012-09-24 18:40 ` Andrey Borzenkov
2012-09-25 4:46 ` Michael Chang
2012-09-25 15:24 ` Andrey Borzenkov
2012-09-25 18:52 ` Andrey Borzenkov [this message]
2012-09-25 21:54 ` Colin Watson
2012-09-26 7:44 ` Michael Chang
2012-09-26 12:52 ` Colin Watson
2012-09-25 3:49 ` Michael Chang
2012-09-25 21:52 ` Colin Watson
2013-04-05 7:23 ` Andrey Borzenkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1348599144.1760.2.camel@opensuse.site \
--to=arvidjaar@gmail.com \
--cc=grub-devel@gnu.org \
--cc=mchang@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.