From fade719ed906ad7aa73204ca84747047bae3d7bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Wed, 28 Nov 2012 18:29:56 -0500 Subject: [PATCH] lxc-ubuntu: Guess a list of langpacks to install MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Acked-by: Serge E. Hallyn --- templates/lxc-ubuntu.in | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/templates/lxc-ubuntu.in b/templates/lxc-ubuntu.in index c9d464987..ce1e06568 100644 --- a/templates/lxc-ubuntu.in +++ b/templates/lxc-ubuntu.in @@ -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