[lxc-devel] [PATCH 2/4] lxc-ubuntu: Guess a list of langpacks to install

Stéphane Graber stgraber at ubuntu.com
Thu Nov 29 15:09:43 UTC 2012


On 11/29/2012 09:49 AM, Serge Hallyn wrote:
> Quoting Stéphane Graber (stgraber at ubuntu.com):
>> 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 at ubuntu.com>
>> ---
>>  templates/lxc-ubuntu.in | 12 ++++++++++++
>>  1 file changed, 12 insertions(+)
>>
>> diff --git a/templates/lxc-ubuntu.in b/templates/lxc-ubuntu.in
>> index c9d4649..ce1e065 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 &&
> 
> Where does this LANGPACK_LIST come from?

Doh, I should have been more careful when renaming variables :)

Anyway, I fixed it now and sent the fix to lxc-devel, good catch!

>> +                    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
>> -- 
>> 1.8.0
>>
>>
>> ------------------------------------------------------------------------------
>> Keep yourself connected to Go Parallel: 
>> INSIGHTS What's next for parallel hardware, programming and related areas?
>> Interviews and blogs by thought leaders keep you ahead of the curve.
>> http://goparallel.sourceforge.net
>> _______________________________________________
>> Lxc-devel mailing list
>> Lxc-devel at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/lxc-devel


-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 899 bytes
Desc: OpenPGP digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20121129/8790b536/attachment.pgp>


More information about the lxc-devel mailing list