From dc7f65454ee88fbd50f4d6f8a7c567eb27107314 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Graber?= Date: Wed, 24 Apr 2013 21:38:32 +0200 Subject: [PATCH] ubuntu: Don't break when the locale is C.* MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- 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 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 -- 2.47.2