diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-11-09 15:00:01 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-11-10 11:51:19 +0000 |
commit | c8dee9b92dfd545852ecac8dc2adfc95ac02e957 (patch) | |
tree | 5f1b86954646a0f3bb914407994388a6a4346769 /meta/classes/libc-package.bbclass | |
parent | 5d3860f4a8abb8e95442b04f8b84a333af362fcd (diff) | |
download | poky-c8dee9b92dfd545852ecac8dc2adfc95ac02e957.tar.gz |
Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:
sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`
(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/libc-package.bbclass')
-rw-r--r-- | meta/classes/libc-package.bbclass | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/meta/classes/libc-package.bbclass b/meta/classes/libc-package.bbclass index 6ef2f97254..fc1a5794d7 100644 --- a/meta/classes/libc-package.bbclass +++ b/meta/classes/libc-package.bbclass | |||
@@ -10,7 +10,7 @@ | |||
10 | GLIBC_INTERNAL_USE_BINARY_LOCALE ?= "ondevice" | 10 | GLIBC_INTERNAL_USE_BINARY_LOCALE ?= "ondevice" |
11 | 11 | ||
12 | python __anonymous () { | 12 | python __anonymous () { |
13 | enabled = bb.data.getVar("ENABLE_BINARY_LOCALE_GENERATION", d, 1) | 13 | enabled = d.getVar("ENABLE_BINARY_LOCALE_GENERATION", 1) |
14 | 14 | ||
15 | pn = d.getVar("PN", True) | 15 | pn = d.getVar("PN", True) |
16 | if pn.endswith("-initial"): | 16 | if pn.endswith("-initial"): |
@@ -19,21 +19,21 @@ python __anonymous () { | |||
19 | if enabled and int(enabled): | 19 | if enabled and int(enabled): |
20 | import re | 20 | import re |
21 | 21 | ||
22 | target_arch = bb.data.getVar("TARGET_ARCH", d, 1) | 22 | target_arch = d.getVar("TARGET_ARCH", 1) |
23 | binary_arches = bb.data.getVar("BINARY_LOCALE_ARCHES", d, 1) or "" | 23 | binary_arches = d.getVar("BINARY_LOCALE_ARCHES", 1) or "" |
24 | use_cross_localedef = bb.data.getVar("LOCALE_GENERATION_WITH_CROSS-LOCALEDEF", d, 1) or "" | 24 | use_cross_localedef = d.getVar("LOCALE_GENERATION_WITH_CROSS-LOCALEDEF", 1) or "" |
25 | 25 | ||
26 | for regexp in binary_arches.split(" "): | 26 | for regexp in binary_arches.split(" "): |
27 | r = re.compile(regexp) | 27 | r = re.compile(regexp) |
28 | 28 | ||
29 | if r.match(target_arch): | 29 | if r.match(target_arch): |
30 | depends = bb.data.getVar("DEPENDS", d, 1) | 30 | depends = d.getVar("DEPENDS", 1) |
31 | if use_cross_localedef == "1" : | 31 | if use_cross_localedef == "1" : |
32 | depends = "%s cross-localedef-native" % depends | 32 | depends = "%s cross-localedef-native" % depends |
33 | else: | 33 | else: |
34 | depends = "%s qemu-native" % depends | 34 | depends = "%s qemu-native" % depends |
35 | bb.data.setVar("DEPENDS", depends, d) | 35 | d.setVar("DEPENDS", depends) |
36 | bb.data.setVar("GLIBC_INTERNAL_USE_BINARY_LOCALE", "compile", d) | 36 | d.setVar("GLIBC_INTERNAL_USE_BINARY_LOCALE", "compile") |
37 | break | 37 | break |
38 | } | 38 | } |
39 | 39 | ||
@@ -109,19 +109,19 @@ inherit qemu | |||
109 | 109 | ||
110 | python package_do_split_gconvs () { | 110 | python package_do_split_gconvs () { |
111 | import os, re | 111 | import os, re |
112 | if (bb.data.getVar('PACKAGE_NO_GCONV', d, 1) == '1'): | 112 | if (d.getVar('PACKAGE_NO_GCONV', 1) == '1'): |
113 | bb.note("package requested not splitting gconvs") | 113 | bb.note("package requested not splitting gconvs") |
114 | return | 114 | return |
115 | 115 | ||
116 | if not bb.data.getVar('PACKAGES', d, 1): | 116 | if not d.getVar('PACKAGES', 1): |
117 | return | 117 | return |
118 | 118 | ||
119 | bpn = bb.data.getVar('BPN', d, 1) | 119 | bpn = d.getVar('BPN', 1) |
120 | libdir = bb.data.getVar('libdir', d, 1) | 120 | libdir = d.getVar('libdir', 1) |
121 | if not libdir: | 121 | if not libdir: |
122 | bb.error("libdir not defined") | 122 | bb.error("libdir not defined") |
123 | return | 123 | return |
124 | datadir = bb.data.getVar('datadir', d, 1) | 124 | datadir = d.getVar('datadir', 1) |
125 | if not datadir: | 125 | if not datadir: |
126 | bb.error("datadir not defined") | 126 | bb.error("datadir not defined") |
127 | return | 127 | return |
@@ -191,17 +191,17 @@ python package_do_split_gconvs () { | |||
191 | 191 | ||
192 | do_split_packages(d, locales_dir, file_regex='(.*)', output_pattern=bpn+'-localedata-%s', \ | 192 | do_split_packages(d, locales_dir, file_regex='(.*)', output_pattern=bpn+'-localedata-%s', \ |
193 | description='locale definition for %s', hook=calc_locale_deps, extra_depends='') | 193 | description='locale definition for %s', hook=calc_locale_deps, extra_depends='') |
194 | bb.data.setVar('PACKAGES', bb.data.getVar('PACKAGES', d) + ' ' + bb.data.getVar('MLPREFIX', d) + bpn + '-gconv', d) | 194 | bb.data.setVar('PACKAGES', d.getVar('PACKAGES') + ' ' + d.getVar('MLPREFIX') + bpn + '-gconv', d) |
195 | 195 | ||
196 | use_bin = bb.data.getVar("GLIBC_INTERNAL_USE_BINARY_LOCALE", d, 1) | 196 | use_bin = d.getVar("GLIBC_INTERNAL_USE_BINARY_LOCALE", 1) |
197 | 197 | ||
198 | dot_re = re.compile("(.*)\.(.*)") | 198 | dot_re = re.compile("(.*)\.(.*)") |
199 | 199 | ||
200 | #GLIBC_GENERATE_LOCALES var specifies which locales to be supported, empty or "all" means all locales | 200 | #GLIBC_GENERATE_LOCALES var specifies which locales to be supported, empty or "all" means all locales |
201 | if use_bin != "precompiled": | 201 | if use_bin != "precompiled": |
202 | supported = bb.data.getVar('GLIBC_GENERATE_LOCALES', d, 1) | 202 | supported = d.getVar('GLIBC_GENERATE_LOCALES', 1) |
203 | if not supported or supported == "all": | 203 | if not supported or supported == "all": |
204 | f = open(base_path_join(bb.data.getVar('WORKDIR', d, 1), "SUPPORTED"), "r") | 204 | f = open(base_path_join(d.getVar('WORKDIR', 1), "SUPPORTED"), "r") |
205 | supported = f.readlines() | 205 | supported = f.readlines() |
206 | f.close() | 206 | f.close() |
207 | else: | 207 | else: |
@@ -209,7 +209,7 @@ python package_do_split_gconvs () { | |||
209 | supported = map(lambda s:s.replace(".", " ") + "\n", supported) | 209 | supported = map(lambda s:s.replace(".", " ") + "\n", supported) |
210 | else: | 210 | else: |
211 | supported = [] | 211 | supported = [] |
212 | full_bin_path = bb.data.getVar('PKGD', d, True) + binary_locales_dir | 212 | full_bin_path = d.getVar('PKGD', True) + binary_locales_dir |
213 | for dir in os.listdir(full_bin_path): | 213 | for dir in os.listdir(full_bin_path): |
214 | dbase = dir.split(".") | 214 | dbase = dir.split(".") |
215 | d2 = " " | 215 | d2 = " " |
@@ -218,7 +218,7 @@ python package_do_split_gconvs () { | |||
218 | supported.append(dbase[0] + d2) | 218 | supported.append(dbase[0] + d2) |
219 | 219 | ||
220 | # Collate the locales by base and encoding | 220 | # Collate the locales by base and encoding |
221 | utf8_only = int(bb.data.getVar('LOCALE_UTF8_ONLY', d, 1) or 0) | 221 | utf8_only = int(d.getVar('LOCALE_UTF8_ONLY', 1) or 0) |
222 | encodings = {} | 222 | encodings = {} |
223 | for l in supported: | 223 | for l in supported: |
224 | l = l[:-1] | 224 | l = l[:-1] |
@@ -235,9 +235,9 @@ python package_do_split_gconvs () { | |||
235 | def output_locale_source(name, pkgname, locale, encoding): | 235 | def output_locale_source(name, pkgname, locale, encoding): |
236 | bb.data.setVar('RDEPENDS_%s' % pkgname, 'localedef %s-localedata-%s %s-charmap-%s' % \ | 236 | bb.data.setVar('RDEPENDS_%s' % pkgname, 'localedef %s-localedata-%s %s-charmap-%s' % \ |
237 | (bpn, legitimize_package_name(locale), bpn, legitimize_package_name(encoding)), d) | 237 | (bpn, legitimize_package_name(locale), bpn, legitimize_package_name(encoding)), d) |
238 | bb.data.setVar('pkg_postinst_%s' % pkgname, bb.data.getVar('locale_base_postinst', d, 1) \ | 238 | bb.data.setVar('pkg_postinst_%s' % pkgname, d.getVar('locale_base_postinst', 1) \ |
239 | % (locale, encoding, locale), d) | 239 | % (locale, encoding, locale), d) |
240 | bb.data.setVar('pkg_postrm_%s' % pkgname, bb.data.getVar('locale_base_postrm', d, 1) % \ | 240 | bb.data.setVar('pkg_postrm_%s' % pkgname, d.getVar('locale_base_postrm', 1) % \ |
241 | (locale, encoding, locale), d) | 241 | (locale, encoding, locale), d) |
242 | 242 | ||
243 | def output_locale_binary_rdepends(name, pkgname, locale, encoding): | 243 | def output_locale_binary_rdepends(name, pkgname, locale, encoding): |
@@ -248,23 +248,23 @@ python package_do_split_gconvs () { | |||
248 | libc_name = name | 248 | libc_name = name |
249 | bb.data.setVar('RDEPENDS_%s' % pkgname, legitimize_package_name('%s-binary-localedata-%s' \ | 249 | bb.data.setVar('RDEPENDS_%s' % pkgname, legitimize_package_name('%s-binary-localedata-%s' \ |
250 | % (bpn, libc_name)), d) | 250 | % (bpn, libc_name)), d) |
251 | rprovides = (bb.data.getVar('RPROVIDES_%s' % pkgname, d, True) or "").split() | 251 | rprovides = (d.getVar('RPROVIDES_%s' % pkgname, True) or "").split() |
252 | rprovides.append(legitimize_package_name('%s-binary-localedata-%s' % (bpn, libc_name))) | 252 | rprovides.append(legitimize_package_name('%s-binary-localedata-%s' % (bpn, libc_name))) |
253 | bb.data.setVar('RPROVIDES_%s' % pkgname, " ".join(rprovides), d) | 253 | bb.data.setVar('RPROVIDES_%s' % pkgname, " ".join(rprovides), d) |
254 | 254 | ||
255 | commands = {} | 255 | commands = {} |
256 | 256 | ||
257 | def output_locale_binary(name, pkgname, locale, encoding): | 257 | def output_locale_binary(name, pkgname, locale, encoding): |
258 | treedir = base_path_join(bb.data.getVar("WORKDIR", d, 1), "locale-tree") | 258 | treedir = base_path_join(d.getVar("WORKDIR", 1), "locale-tree") |
259 | ldlibdir = base_path_join(treedir, bb.data.getVar("base_libdir", d, 1)) | 259 | ldlibdir = base_path_join(treedir, d.getVar("base_libdir", 1)) |
260 | path = bb.data.getVar("PATH", d, 1) | 260 | path = d.getVar("PATH", 1) |
261 | i18npath = base_path_join(treedir, datadir, "i18n") | 261 | i18npath = base_path_join(treedir, datadir, "i18n") |
262 | gconvpath = base_path_join(treedir, "iconvdata") | 262 | gconvpath = base_path_join(treedir, "iconvdata") |
263 | outputpath = base_path_join(treedir, libdir, "locale") | 263 | outputpath = base_path_join(treedir, libdir, "locale") |
264 | 264 | ||
265 | use_cross_localedef = bb.data.getVar("LOCALE_GENERATION_WITH_CROSS-LOCALEDEF", d, 1) or "0" | 265 | use_cross_localedef = d.getVar("LOCALE_GENERATION_WITH_CROSS-LOCALEDEF", 1) or "0" |
266 | if use_cross_localedef == "1": | 266 | if use_cross_localedef == "1": |
267 | target_arch = bb.data.getVar('TARGET_ARCH', d, True) | 267 | target_arch = d.getVar('TARGET_ARCH', True) |
268 | locale_arch_options = { \ | 268 | locale_arch_options = { \ |
269 | "arm": " --uint32-align=4 --little-endian ", \ | 269 | "arm": " --uint32-align=4 --little-endian ", \ |
270 | "powerpc": " --uint32-align=4 --big-endian ", \ | 270 | "powerpc": " --uint32-align=4 --big-endian ", \ |
@@ -292,9 +292,9 @@ python package_do_split_gconvs () { | |||
292 | --inputfile=%s/i18n/locales/%s --charmap=%s %s" \ | 292 | --inputfile=%s/i18n/locales/%s --charmap=%s %s" \ |
293 | % (treedir, datadir, locale, encoding, name) | 293 | % (treedir, datadir, locale, encoding, name) |
294 | 294 | ||
295 | qemu_options = bb.data.getVar("QEMU_OPTIONS_%s" % bb.data.getVar('PACKAGE_ARCH', d, 1), d, 1) | 295 | qemu_options = bb.data.getVar("QEMU_OPTIONS_%s" % d.getVar('PACKAGE_ARCH', 1), d, 1) |
296 | if not qemu_options: | 296 | if not qemu_options: |
297 | qemu_options = bb.data.getVar('QEMU_OPTIONS', d, 1) | 297 | qemu_options = d.getVar('QEMU_OPTIONS', 1) |
298 | 298 | ||
299 | cmd = "PSEUDO_RELOADED=YES PATH=\"%s\" I18NPATH=\"%s\" %s -L %s \ | 299 | cmd = "PSEUDO_RELOADED=YES PATH=\"%s\" I18NPATH=\"%s\" %s -L %s \ |
300 | -E LD_LIBRARY_PATH=%s %s %s/bin/localedef %s" % \ | 300 | -E LD_LIBRARY_PATH=%s %s %s/bin/localedef %s" % \ |
@@ -305,14 +305,14 @@ python package_do_split_gconvs () { | |||
305 | bb.note("generating locale %s (%s)" % (locale, encoding)) | 305 | bb.note("generating locale %s (%s)" % (locale, encoding)) |
306 | 306 | ||
307 | def output_locale(name, locale, encoding): | 307 | def output_locale(name, locale, encoding): |
308 | pkgname = bb.data.getVar('MLPREFIX', d) + 'locale-base-' + legitimize_package_name(name) | 308 | pkgname = d.getVar('MLPREFIX') + 'locale-base-' + legitimize_package_name(name) |
309 | bb.data.setVar('ALLOW_EMPTY_%s' % pkgname, '1', d) | 309 | d.setVar('ALLOW_EMPTY_%s' % pkgname, '1') |
310 | bb.data.setVar('PACKAGES', '%s %s' % (pkgname, bb.data.getVar('PACKAGES', d, 1)), d) | 310 | bb.data.setVar('PACKAGES', '%s %s' % (pkgname, d.getVar('PACKAGES', 1)), d) |
311 | rprovides = ' virtual-locale-%s' % legitimize_package_name(name) | 311 | rprovides = ' virtual-locale-%s' % legitimize_package_name(name) |
312 | m = re.match("(.*)_(.*)", name) | 312 | m = re.match("(.*)_(.*)", name) |
313 | if m: | 313 | if m: |
314 | rprovides += ' virtual-locale-%s' % m.group(1) | 314 | rprovides += ' virtual-locale-%s' % m.group(1) |
315 | bb.data.setVar('RPROVIDES_%s' % pkgname, rprovides, d) | 315 | d.setVar('RPROVIDES_%s' % pkgname, rprovides) |
316 | 316 | ||
317 | if use_bin == "compile": | 317 | if use_bin == "compile": |
318 | output_locale_binary_rdepends(name, pkgname, locale, encoding) | 318 | output_locale_binary_rdepends(name, pkgname, locale, encoding) |
@@ -347,7 +347,7 @@ python package_do_split_gconvs () { | |||
347 | bb.note(" " + " ".join(non_utf8)) | 347 | bb.note(" " + " ".join(non_utf8)) |
348 | 348 | ||
349 | if use_bin == "compile": | 349 | if use_bin == "compile": |
350 | makefile = base_path_join(bb.data.getVar("WORKDIR", d, 1), "locale-tree", "Makefile") | 350 | makefile = base_path_join(d.getVar("WORKDIR", 1), "locale-tree", "Makefile") |
351 | m = open(makefile, "w") | 351 | m = open(makefile, "w") |
352 | m.write("all: %s\n\n" % " ".join(commands.keys())) | 352 | m.write("all: %s\n\n" % " ".join(commands.keys())) |
353 | for cmd in commands: | 353 | for cmd in commands: |