]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
ubuntu: Don't break when the locale is C.*
authorStéphane Graber <stgraber@ubuntu.com>
Wed, 24 Apr 2013 19:38:32 +0000 (21:38 +0200)
committerStéphane Graber <stgraber@ubuntu.com>
Wed, 24 Apr 2013 23:31:11 +0000 (01:31 +0200)
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@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
templates/lxc-ubuntu.in

index 83311fddeb523b64c2117c993d1605a19350188d..7100acc878669a0b25968fbd79d3d666085acbf8 100644 (file)
@@ -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