From: Stéphane Graber Date: Wed, 24 Apr 2013 19:38:32 +0000 (+0200) Subject: ubuntu: Don't break when the locale is C.* X-Git-Tag: lxc-1.0.0.alpha1~1^2~267 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc7f65454ee88fbd50f4d6f8a7c567eb27107314;p=thirdparty%2Flxc.git ubuntu: Don't break when the locale is C.* 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 Acked-by: Serge E. Hallyn --- diff --git a/templates/lxc-ubuntu.in b/templates/lxc-ubuntu.in index 83311fdde..7100acc87 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