glibc, local.conf.sample: Introduce and handle new OE variable, GLIBC_GENERATE_LOCALES
authorPaul Sokolovsky <pmiscml@gmail.com>
Sun, 25 Mar 2007 18:06:11 +0000 (18:06 +0000)
committerPaul Sokolovsky <pmiscml@gmail.com>
Sun, 25 Mar 2007 18:06:11 +0000 (18:06 +0000)
to limit set of generated binary locales.
* If ENABLE_BINARY_LOCALE_GENERATION is set to "1", you can limit locales
generated to the list provided by GLIBC_GENERATE_LOCALES. This is huge
time-savior for developmental builds. Format: list of locale.encoding pairs
with spaces as separators, e.g.:
GLIBC_GENERATE_LOCALES = "en_GB.UTF-8 de_DE.UTF-8"
* Check your distro for minimal set of locales required. Old-time default is
"en_GB.UTF-8 de_DE.UTF-8 fr_FR.UTF-8".
* Angstrom requires en_GB only.
* This commit does not changes the default, which is still generation of all
available locales.
* Closes #1966.

conf/local.conf.sample
packages/glibc/glibc-package.bbclass

index 02d5468..daffdda 100644 (file)
@@ -90,6 +90,12 @@ PREFERRED_PROVIDERS += " virtual/${TARGET_PREFIX}g++:gcc-cross"
 # ENABLE_BINARY_LOCALE_GENERATION = "0"
 # ASSUME_PROVIDED += "qemu-native"
 
+# If ENABLE_BINARY_LOCALE_GENERATION is set to "1", you can limit locales
+# generated to the list provided by GLIBC_GENERATE_LOCALES. This is huge
+# time-savior for developmental builds. Format: list of locale.encoding pairs
+# with spaces as separators.
+# GLIBC_GENERATE_LOCALES = "en_GB.UTF-8 de_DE.UTF-8"
+
 # Uncomment this to select a particular major kernel version if the MACHINE setting
 # supports more than one major kernel version. Currently this is suported by the
 # following MACHINE types: poodle, tosa and simpad.
index 5783ab1..4bd4223 100644 (file)
@@ -202,9 +202,14 @@ python package_do_split_gconvs () {
        do_split_packages(d, locales_dir, file_regex='(.*)', output_pattern='glibc-localedata-%s', description='locale definition for %s', hook=calc_locale_deps, extra_depends='')
        bb.data.setVar('PACKAGES', bb.data.getVar('PACKAGES', d) + ' glibc-gconv', d)
 
-       f = open(os.path.join(bb.data.getVar('WORKDIR', d, 1), "SUPPORTED"), "r")
-       supported = f.readlines()
-       f.close()
+       supported = bb.data.getVar('GLIBC_GENERATE_LOCALES', d, 1)
+       if not supported or supported == "all":
+           f = open(os.path.join(bb.data.getVar('WORKDIR', d, 1), "SUPPORTED"), "r")
+           supported = f.readlines()
+           f.close()
+       else:
+           supported = supported.split()
+           supported = map(lambda s:s.replace(".", " ") + "\n", supported)
 
        dot_re = re.compile("(.*)\.(.*)")