]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc-ubuntu: Guess a list of langpacks to install
authorStéphane Graber <stgraber@ubuntu.com>
Wed, 28 Nov 2012 23:29:56 +0000 (18:29 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Thu, 29 Nov 2012 15:26:23 +0000 (10:26 -0500)
In addition to creating the current locale in the container, also
try to scan the host and extra the list of langpacks installed there,
then pass that list to debootstrap as additional packages to install.

On distros that don't have dpkg, only language-pack-en will be installed.
The code will always ensure that language-pack-en is ALWAYS installed in the
target, similar to what Ubuntu does with its various media.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
templates/lxc-ubuntu.in

index c9d464987695984946f6b1d242f9ec89d92ce0e3..ce1e065686030b577aae8e3863fbc7f7d423f134 100644 (file)
@@ -174,6 +174,18 @@ download_ubuntu()
     release=$3
 
     packages=vim,ssh
+
+    # Try to guess a list of langpacks to install
+    langpacks="language-pack-en"
+
+    if which dpkg >/dev/null 2>&1; then
+        langpacks=`(echo $LANGPACK_LIST &&
+                    dpkg -l | grep -E "^ii  language-pack-[a-z]* " |
+                        cut -d ' ' -f3) | sort -u`
+    fi
+    packages="$packages,$(echo $langpacks | sed 's/ /,/g')"
+
+
     echo "installing packages: $packages"
 
     trap cleanup EXIT SIGHUP SIGINT SIGTERM