[lxc-devel] [PATCH] ubuntu: Don't break when the locale is C.*

Serge Hallyn serge.hallyn at ubuntu.com
Wed Apr 24 20:02:23 UTC 2013


Quoting Stéphane Graber (stgraber at ubuntu.com):
> Update the code to also match C.* so that C.UTF-8 doesn't make the
> container creation fail.
> 
> Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>

Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>

> ---
>  templates/lxc-ubuntu.in | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/templates/lxc-ubuntu.in b/templates/lxc-ubuntu.in
> index 83311fd..7100acc 100644
> --- a/templates/lxc-ubuntu.in
> +++ b/templates/lxc-ubuntu.in
> @@ -81,14 +81,12 @@ EOF
>      fi
>  
>      # make sure we have the current locale defined in the container
> -    if [ -z "$LANG" ]; then
> +    if [ -z "$LANG" ] || echo $LANG | grep -E -q "^C(\..+)*$"; then
>          chroot $rootfs locale-gen en_US.UTF-8
>          chroot $rootfs update-locale LANG=en_US.UTF-8
>      else
> -        if [ "$LANG" != "C" ]; then
> -            chroot $rootfs locale-gen $LANG
> -            chroot $rootfs update-locale LANG=$LANG
> -        fi
> +        chroot $rootfs locale-gen $LANG
> +        chroot $rootfs update-locale LANG=$LANG
>      fi
>  
>      # generate new SSH keys
> -- 
> 1.8.1.2
> 
> 
> ------------------------------------------------------------------------------
> Try New Relic Now & We'll Send You this Cool Shirt
> New Relic is the only SaaS-based application performance monitoring service 
> that delivers powerful full stack analytics. Optimize and monitor your
> browser, app, & servers with just a few lines of code. Try New Relic
> and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
> _______________________________________________
> Lxc-devel mailing list
> Lxc-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-devel




More information about the lxc-devel mailing list