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

Serge Hallyn serge.hallyn at canonical.com
Thu Nov 29 15:30:35 UTC 2012


Quoting Stéphane Graber (stgraber at ubuntu.com):
> On 11/29/2012 10:18 AM, Serge Hallyn wrote:
> > Quoting Stéphane Graber (stgraber at ubuntu.com):
> >> 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!
> > 
> > Another question, do we definately want this?  I sort of prefer
> > to keep the containers more minimal by default.  The default
> > langpack is needed to avoid funkiness over ssh, but the others
> > seem like perhaps more than is needed?
> 
> So, the problem is that ssh appears to forward LANG to the server, which
> will lead to encoding problems if a matching locale doesn't exist.
> 
> Installing the same langpacks as the host will guarantee that ssh from
> the host to the container won't ever give you weird encoding problems.
> 
> On all english systems, my code will only install language-pack-en, on
> systems using a different locale, it'll install language-pack-en and the
> language-pack-<LANGUAGE CODE>, so it shouldn't be a huge waste of space.

Ok, I thought the default langpack would solve that problem.  Guess it's
not enough.

Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>

Thanks, sorry about all the questions :)




More information about the lxc-devel mailing list