From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1TGaFG-0007Y7-IC for mharc-grub-devel@gnu.org; Tue, 25 Sep 2012 14:52:34 -0400 Received: from eggs.gnu.org ([208.118.235.92]:37961) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGaFD-0007Xt-QJ for grub-devel@gnu.org; Tue, 25 Sep 2012 14:52:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TGaFB-0003Ds-IB for grub-devel@gnu.org; Tue, 25 Sep 2012 14:52:31 -0400 Received: from mail-lb0-f169.google.com ([209.85.217.169]:54321) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGaFB-0003De-A5 for grub-devel@gnu.org; Tue, 25 Sep 2012 14:52:29 -0400 Received: by lbok6 with SMTP id k6so635298lbo.0 for ; Tue, 25 Sep 2012 11:52:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:cc:date:in-reply-to:references :content-type:x-mailer:mime-version; bh=R/z+ZGlzuHNFoU4Raud1fKTCpDZs7rcbWSQnU8SfINY=; b=XeReI1tQxffEc6V0XAzLtS8DSkarItET5++/0uOY458epQvI0NZrm+6G1HgTxtvQWj k8gfuawI8RSazn+P06qtuqM7qTm9bH6xZQIokx1XUHj64On1/cHIstKzzmvhp8q6DSrf vG+s/QKh+amKPE6r9xtFVUC8TBnsKbBjdoue34bYV5J75WeJf/JQGPdec9MhZDqRiYtE 3laO+Xpg6/jRavdjoOmh7XHDYn2KTC1QdDRzFcY7o4b7JugM6tPFf5jRiqqP687yCXD8 0mwrNYbbbenk0hv9YlMHjdh1IUtmJx1c42cWigK7komk5W0mZeg9v5oNbWhFdo0z9+p+ toQA== Received: by 10.112.82.6 with SMTP id e6mr5930506lby.93.1348599147830; Tue, 25 Sep 2012 11:52:27 -0700 (PDT) Received: from [192.168.10.142] (ppp83-237-37-219.pppoe.mtu-net.ru. [83.237.37.219]) by mx.google.com with ESMTPS id xw14sm301774lab.15.2012.09.25.11.52.25 (version=SSLv3 cipher=OTHER); Tue, 25 Sep 2012 11:52:26 -0700 (PDT) Message-ID: <1348599144.1760.2.camel@opensuse.site> Subject: Re: [PATCH] suppress error message "/grub2/locale/en.mo.gz not found" From: Andrey Borzenkov To: Michael Chang Date: Tue, 25 Sep 2012 22:52:24 +0400 In-Reply-To: <1348586655.1610.3.camel@opensuse.site> References: <1348469509-21079-1-git-send-email-mchang@suse.com> <506029C8.8000804@kiilerich.com> <1348512057.1612.10.camel@opensuse.site> <1348586655.1610.3.camel@opensuse.site> Content-Type: multipart/mixed; boundary="=-GfQV0u1sYk4tDBtmAK75" X-Mailer: Evolution 3.4.4 Mime-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.217.169 Cc: The development of GNU GRUB X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Sep 2012 18:52:32 -0000 --=-GfQV0u1sYk4tDBtmAK75 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit В Вт., 25/09/2012 в 19:24 +0400, Andrey Borzenkov пишет: > В Вт., 25/09/2012 в 12:46 +0800, Michael Chang пишет: > > 2012/9/25 Andrey Borzenkov : > > > В Пн., 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. --=-GfQV0u1sYk4tDBtmAK75 Content-Disposition: attachment; filename="grub2-no-error-on-missing-message-catalog.patch" Content-Type: text/x-patch; name="grub2-no-error-on-missing-message-catalog.patch"; charset="UTF-8" Content-Transfer-Encoding: 7bit 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 * --=-GfQV0u1sYk4tDBtmAK75--