]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc-debian: Force locales generation
authorLaurent Vallar <val@zbla.net>
Wed, 16 Oct 2013 16:04:15 +0000 (18:04 +0200)
committerStéphane Graber <stgraber@ubuntu.com>
Thu, 17 Oct 2013 20:44:20 +0000 (16:44 -0400)
Signed-off-by: Laurent Vallar <val@zbla.net>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
templates/lxc-debian.in

index 915afa414bf1958aeb9ee25a768a4f137ce58835..d0a16773b605c48fe9b4c0f9ab07c286375ade39 100644 (file)
@@ -80,7 +80,10 @@ EOF
         chroot $rootfs locale-gen en_US.UTF-8 UTF-8
         chroot $rootfs update-locale LANG=en_US.UTF-8
     else
-        chroot $rootfs locale-gen $LANG $(echo $LANG | cut -d. -f2)
+        encoding=$(echo $LANG | cut -d. -f2)
+        chroot $rootfs perl -pe "s/^# (${LANG} ${encoding})/\1/" \
+            -i /etc/locale.gen 2>/dev/null
+        chroot $rootfs locale-gen $LANG $encoding
         chroot $rootfs update-locale LANG=$LANG
     fi