clr2def: Add LC_CTYPE source file generation support

Operating Systems / DragonFlyBSD - John Marino [marino.st] - 1 August 2015 13:00 UTC

I added the capability to generate LC_CTYPE source files (really this is basically extracting a section from the POSIX files) but there was some logic to figure out how to use the least amount of files because some of them are large.

I compromised on a scheme that makes two reductions. The first eliminates true duplicates and uses the SAME+= mechanism to create symlinks. However, this leaves still some duplicates because while the output is distinct, the source files are the same (e.g. en_US.ISO8859* uses the same input file as en_US.UTF-8 locale, but the LC_CTYPE products differ. The script identifies those are replaces them with symlinks. So it looks like a lot of files but really it's only about 12 or so.

During the actual LC_CTYPE generating, character maps are needed. I added a Illumos tool to do this, which I had to modify. Unlike Illumos, we will pregenerate the maps that the tool (convert_map.pl) produces. I had to spend hours troubleshooting various "invalid" inputs so this is definitely something that should not be repeated in the build.

ce02c39 clr2def: Add LC_CTYPE source file generation support
tools/tools/locale/Makefile | 7 +-
tools/tools/locale/tools/cldr2def.pl | 123 ++++++++++++++++++--
tools/tools/locale/tools/convert_map.pl | 192 +++++++++++++++++++++++++++++++
tools/tools/locale/tools/finalize | 48 +++++++-
4 files changed, 355 insertions(+), 15 deletions(-)

Upstream: gitweb.dragonflybsd.org


  • Share