]> code.ossystems Code Review - openembedded-core.git/commit
libc-package: rework ''precompiled' locale handling
authorChristopher Larson <kergoth@gmail.com>
Fri, 27 Apr 2012 04:03:55 +0000 (23:03 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 3 May 2012 14:00:26 +0000 (15:00 +0100)
commit3f36058923ccda25a3dd85046542e65b6034c09e
treeab705ccfbe762d42fe18d44c27d6037f433b85cf
parent7808c7ee9277170fbfb22bcf0575285174c2718a
libc-package: rework ''precompiled' locale handling

There were a couple problems with the handling of precompiled locales.

- it gathered the list of locales from the directories - this breaks due to
  the naming mismatch, e.g. en_US.UTF-8 vs en_US.utf8.
- it retained its hardcoded assumption that the non-suffixed locale (en_US, as
  opposed to en_US.*) is UTF-8, while the others are otherwise. Hardcoding
  this is both inflexible and just plain wrong for some toolchains. It's most
  common in desktop distros for 'en_US' to be non-utf8, and ''en_US.UTF-8' is
  utf8, and this is the case in some external toolchains as well.

The code now uses the SUPPORTED file to hold the knowledge it needs. This file
not only holds the list of locales to generate, but also maps the locale names
to the charsets they correspond to. The code now uses this to assemble its
charset map, falling back to the '.' suffix as charset when the locale is not
in the map. For precompiled, it now uses the locale->charset knowledge it has,
thereby allowing non-utf8 non-suffixed locale names, whereas for
non-precompiled, it reverts to the previous assumption, renaming the utf8
locale and forcibly suffixing the others.

So, a person maintaining an external toolchain recipe is responsible for
ensuring that the SUPPORTED file they provide matches up with the compiled
locales in the toolchain, if they want to utilize precompiled locales.

I believe in the long term the compiled case should do the same thing
precompiled does, and use SUPPORTED or a similar mechanism to encode the
knowledge, and if people want all the non-suffixed names to be utf8, they can
change that file to do so. This would avoid the hardcoded assumption in the
code, as well as consolidating the behavior between the compiled and
precompiled cases.

Signed-off-by: Christopher Larson <kergoth@gmail.com>
meta/classes/libc-package.bbclass