WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] XEN: use C locale in bootup message

To: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] XEN: use C locale in bootup message
From: Horms <horms@xxxxxxxxxxxx>
Date: Mon, 4 Sep 2006 09:32:12 +0900
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Mon, 04 Sep 2006 04:16:28 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20060902082328.GC10263@xxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20060901012550.GD29215@xxxxxxxxxxxx> <C11E0D20.21B7%Keir.Fraser@xxxxxxxxxxxx> <20060902082328.GC10263@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: mutt-ng/devel-r804 (Debian)
On Sat, Sep 02, 2006 at 05:23:30PM +0900, Horms wrote:
> On Fri, Sep 01, 2006 at 04:15:28PM +0100, Keir Fraser wrote:
> > On 1/9/06 2:25 am, "Horms" <horms@xxxxxxxxxxxx> wrote:
> > 
> > > The reason that I went with a more general (sledge-hammer) approach as
> > > I'm not sure what other commands may be affected with other locales.
> > > But it is probably safe enough just to set LC_ALL for date. If you would
> > > like me to come up with a more minimal patch that fixes the problem for
> > > Japanese environments at least, and probably all environments, let me
> > > know. Its probably a bit easier for me to test than you.
> > 
> > I'm just uneasy about a patch that is wider ranging than we need. I'd rather
> > just limit the LC_ALL to the invocation of date. If that works okay for you,
> > please send another patch.
> 
> I thought about this a bit futher, and I think your uneasyness is
> well founded. I'll send a more minimal patch shortly.

Hi here is the somewhat obvious minimal patch. I tested it this
morning and it seems to work just fine in my environment, and I think
it should work in any environment.

The LANG=C is probably doing nothing, as for starters it
holds for the sed, figglet and mv invocations. I think
it can be safely removed. Sed is locale sensitive, but
I don't think it takes any notice of LANG.

-- 
Horms
  H: http://www.vergenet.net/~horms/
  W: http://www.valinux.co.jp/en/

XEN: use C locale in bootup message

LC_ALL=C is needed to ensure C locale output in date.
Without this locale-specific, and thus potentially
non-ascii data will end up in include/xen/compile.h which
is displayed on the (often only ascii capable) terminal
at bootup. In any case, its good to have a consistent bootup
message, regadless of the locale prevailing at build.

Signed-Off-By: Simon Horman <horms@xxxxxxxxxxxx>

 xen/Makefile |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

 xen/Makefile |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- x/xen/Makefile
+++ x/xen/Makefile
@@ -92,7 +92,7 @@ include/xen/acm_policy.h:
 # compile.h contains dynamic build info. Rebuilt on every 'make' invocation.
 include/xen/compile.h: LANG=C
 include/xen/compile.h: include/xen/compile.h.in
-       @sed -e 's/@@date@@/$(shell date)/g' \
+       @sed -e 's/@@date@@/$(shell LC_ALL=C date)/g' \
            -e 's/@@time@@/$(shell date +%T)/g' \
            -e 's/@@whoami@@/$(shell whoami)/g' \
            -e 's/@@domain@@/$(shell ([ -x /bin/dnsdomainname ] && 
/bin/dnsdomainname) || ([ -x /bin/domainname ] && /bin/domainname || echo 
[unknown]))/g' \



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>