summaryrefslogtreecommitdiffstats
path: root/meta/classes/libc-package.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-11-25 14:25:16 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-11-27 10:25:34 +0000
commit0a434ac10158e2011d41a1189e65e9474b1672be (patch)
tree6171516b25cb337343a6373e34aec0d061e4f5e8 /meta/classes/libc-package.bbclass
parent71fded5145454b144413057e11f78f718d947093 (diff)
downloadpoky-0a434ac10158e2011d41a1189e65e9474b1672be.tar.gz
getVar/setVar cleanups
Complete the bb.data.getVar/setVar replacements with accesses directly to the data store object. (From OE-Core rev: 2864ff6a4b3c3f9b3bbb6d2597243cc5d3715939) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/libc-package.bbclass')
-rw-r--r--meta/classes/libc-package.bbclass76
1 files changed, 38 insertions, 38 deletions
diff --git a/meta/classes/libc-package.bbclass b/meta/classes/libc-package.bbclass
index fc1a5794d7..bbe06fd54b 100644
--- a/meta/classes/libc-package.bbclass
+++ b/meta/classes/libc-package.bbclass
@@ -10,7 +10,7 @@
10GLIBC_INTERNAL_USE_BINARY_LOCALE ?= "ondevice" 10GLIBC_INTERNAL_USE_BINARY_LOCALE ?= "ondevice"
11 11
12python __anonymous () { 12python __anonymous () {
13 enabled = d.getVar("ENABLE_BINARY_LOCALE_GENERATION", 1) 13 enabled = d.getVar("ENABLE_BINARY_LOCALE_GENERATION", True)
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,15 +19,15 @@ 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 = d.getVar("TARGET_ARCH", 1) 22 target_arch = d.getVar("TARGET_ARCH", True)
23 binary_arches = d.getVar("BINARY_LOCALE_ARCHES", 1) or "" 23 binary_arches = d.getVar("BINARY_LOCALE_ARCHES", True) or ""
24 use_cross_localedef = d.getVar("LOCALE_GENERATION_WITH_CROSS-LOCALEDEF", 1) or "" 24 use_cross_localedef = d.getVar("LOCALE_GENERATION_WITH_CROSS-LOCALEDEF", True) 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 = d.getVar("DEPENDS", 1) 30 depends = d.getVar("DEPENDS", True)
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:
@@ -109,19 +109,19 @@ inherit qemu
109 109
110python package_do_split_gconvs () { 110python package_do_split_gconvs () {
111 import os, re 111 import os, re
112 if (d.getVar('PACKAGE_NO_GCONV', 1) == '1'): 112 if (d.getVar('PACKAGE_NO_GCONV', True) == '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 d.getVar('PACKAGES', 1): 116 if not d.getVar('PACKAGES', True):
117 return 117 return
118 118
119 bpn = d.getVar('BPN', 1) 119 bpn = d.getVar('BPN', True)
120 libdir = d.getVar('libdir', 1) 120 libdir = d.getVar('libdir', True)
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 = d.getVar('datadir', 1) 124 datadir = d.getVar('datadir', True)
125 if not datadir: 125 if not datadir:
126 bb.error("datadir not defined") 126 bb.error("datadir not defined")
127 return 127 return
@@ -144,9 +144,9 @@ python package_do_split_gconvs () {
144 deps.append(dp) 144 deps.append(dp)
145 f.close() 145 f.close()
146 if deps != []: 146 if deps != []:
147 bb.data.setVar('RDEPENDS_%s' % pkg, " ".join(deps), d) 147 d.setVar('RDEPENDS_%s' % pkg, " ".join(deps))
148 if bpn != 'glibc': 148 if bpn != 'glibc':
149 bb.data.setVar('RPROVIDES_%s' % pkg, pkg.replace(bpn, 'glibc'), d) 149 d.setVar('RPROVIDES_%s' % pkg, pkg.replace(bpn, 'glibc'))
150 150
151 do_split_packages(d, gconv_libdir, file_regex='^(.*)\.so$', output_pattern=bpn+'-gconv-%s', \ 151 do_split_packages(d, gconv_libdir, file_regex='^(.*)\.so$', output_pattern=bpn+'-gconv-%s', \
152 description='gconv module for character set %s', hook=calc_gconv_deps, \ 152 description='gconv module for character set %s', hook=calc_gconv_deps, \
@@ -165,9 +165,9 @@ python package_do_split_gconvs () {
165 deps.append(dp) 165 deps.append(dp)
166 f.close() 166 f.close()
167 if deps != []: 167 if deps != []:
168 bb.data.setVar('RDEPENDS_%s' % pkg, " ".join(deps), d) 168 d.setVar('RDEPENDS_%s' % pkg, " ".join(deps))
169 if bpn != 'glibc': 169 if bpn != 'glibc':
170 bb.data.setVar('RPROVIDES_%s' % pkg, pkg.replace(bpn, 'glibc'), d) 170 d.setVar('RPROVIDES_%s' % pkg, pkg.replace(bpn, 'glibc'))
171 171
172 do_split_packages(d, charmap_dir, file_regex='^(.*)\.gz$', output_pattern=bpn+'-charmap-%s', \ 172 do_split_packages(d, charmap_dir, file_regex='^(.*)\.gz$', output_pattern=bpn+'-charmap-%s', \
173 description='character map for %s encoding', hook=calc_charmap_deps, extra_depends='') 173 description='character map for %s encoding', hook=calc_charmap_deps, extra_depends='')
@@ -185,23 +185,23 @@ python package_do_split_gconvs () {
185 deps.append(dp) 185 deps.append(dp)
186 f.close() 186 f.close()
187 if deps != []: 187 if deps != []:
188 bb.data.setVar('RDEPENDS_%s' % pkg, " ".join(deps), d) 188 d.setVar('RDEPENDS_%s' % pkg, " ".join(deps))
189 if bpn != 'glibc': 189 if bpn != 'glibc':
190 bb.data.setVar('RPROVIDES_%s' % pkg, pkg.replace(bpn, 'glibc'), d) 190 d.setVar('RPROVIDES_%s' % pkg, pkg.replace(bpn, 'glibc'))
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', d.getVar('PACKAGES') + ' ' + d.getVar('MLPREFIX') + bpn + '-gconv', d) 194 d.setVar('PACKAGES', d.getVar('PACKAGES') + ' ' + d.getVar('MLPREFIX') + bpn + '-gconv')
195 195
196 use_bin = d.getVar("GLIBC_INTERNAL_USE_BINARY_LOCALE", 1) 196 use_bin = d.getVar("GLIBC_INTERNAL_USE_BINARY_LOCALE", True)
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 = d.getVar('GLIBC_GENERATE_LOCALES', 1) 202 supported = d.getVar('GLIBC_GENERATE_LOCALES', True)
203 if not supported or supported == "all": 203 if not supported or supported == "all":
204 f = open(base_path_join(d.getVar('WORKDIR', 1), "SUPPORTED"), "r") 204 f = open(base_path_join(d.getVar('WORKDIR', True), "SUPPORTED"), "r")
205 supported = f.readlines() 205 supported = f.readlines()
206 f.close() 206 f.close()
207 else: 207 else:
@@ -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(d.getVar('LOCALE_UTF8_ONLY', 1) or 0) 221 utf8_only = int(d.getVar('LOCALE_UTF8_ONLY', True) or 0)
222 encodings = {} 222 encodings = {}
223 for l in supported: 223 for l in supported:
224 l = l[:-1] 224 l = l[:-1]
@@ -233,12 +233,12 @@ python package_do_split_gconvs () {
233 encodings[locale].append(charset) 233 encodings[locale].append(charset)
234 234
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 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)))
238 bb.data.setVar('pkg_postinst_%s' % pkgname, d.getVar('locale_base_postinst', 1) \ 238 d.setVar('pkg_postinst_%s' % pkgname, d.getVar('locale_base_postinst', True) \
239 % (locale, encoding, locale), d) 239 % (locale, encoding, locale))
240 bb.data.setVar('pkg_postrm_%s' % pkgname, d.getVar('locale_base_postrm', 1) % \ 240 d.setVar('pkg_postrm_%s' % pkgname, d.getVar('locale_base_postrm', True) % \
241 (locale, encoding, locale), d) 241 (locale, encoding, locale))
242 242
243 def output_locale_binary_rdepends(name, pkgname, locale, encoding): 243 def output_locale_binary_rdepends(name, pkgname, locale, encoding):
244 m = re.match("(.*)\.(.*)", name) 244 m = re.match("(.*)\.(.*)", name)
@@ -246,23 +246,23 @@ python package_do_split_gconvs () {
246 libc_name = "%s.%s" % (m.group(1), m.group(2).lower().replace("-","")) 246 libc_name = "%s.%s" % (m.group(1), m.group(2).lower().replace("-",""))
247 else: 247 else:
248 libc_name = name 248 libc_name = name
249 bb.data.setVar('RDEPENDS_%s' % pkgname, legitimize_package_name('%s-binary-localedata-%s' \ 249 d.setVar('RDEPENDS_%s' % pkgname, legitimize_package_name('%s-binary-localedata-%s' \
250 % (bpn, libc_name)), d) 250 % (bpn, libc_name)))
251 rprovides = (d.getVar('RPROVIDES_%s' % pkgname, 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 d.setVar('RPROVIDES_%s' % pkgname, " ".join(rprovides))
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(d.getVar("WORKDIR", 1), "locale-tree") 258 treedir = base_path_join(d.getVar("WORKDIR", True), "locale-tree")
259 ldlibdir = base_path_join(treedir, d.getVar("base_libdir", 1)) 259 ldlibdir = base_path_join(treedir, d.getVar("base_libdir", True))
260 path = d.getVar("PATH", 1) 260 path = d.getVar("PATH", True)
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 = d.getVar("LOCALE_GENERATION_WITH_CROSS-LOCALEDEF", 1) or "0" 265 use_cross_localedef = d.getVar("LOCALE_GENERATION_WITH_CROSS-LOCALEDEF", True) or "0"
266 if use_cross_localedef == "1": 266 if use_cross_localedef == "1":
267 target_arch = d.getVar('TARGET_ARCH', True) 267 target_arch = d.getVar('TARGET_ARCH', True)
268 locale_arch_options = { \ 268 locale_arch_options = { \
@@ -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" % d.getVar('PACKAGE_ARCH', 1), d, 1) 295 qemu_options = d.getVar("QEMU_OPTIONS_%s" % d.getVar('PACKAGE_ARCH', True), True)
296 if not qemu_options: 296 if not qemu_options:
297 qemu_options = d.getVar('QEMU_OPTIONS', 1) 297 qemu_options = d.getVar('QEMU_OPTIONS', True)
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" % \
@@ -307,7 +307,7 @@ python package_do_split_gconvs () {
307 def output_locale(name, locale, encoding): 307 def output_locale(name, locale, encoding):
308 pkgname = d.getVar('MLPREFIX') + 'locale-base-' + legitimize_package_name(name) 308 pkgname = d.getVar('MLPREFIX') + 'locale-base-' + legitimize_package_name(name)
309 d.setVar('ALLOW_EMPTY_%s' % pkgname, '1') 309 d.setVar('ALLOW_EMPTY_%s' % pkgname, '1')
310 bb.data.setVar('PACKAGES', '%s %s' % (pkgname, d.getVar('PACKAGES', 1)), d) 310 d.setVar('PACKAGES', '%s %s' % (pkgname, d.getVar('PACKAGES', True)))
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:
@@ -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(d.getVar("WORKDIR", 1), "locale-tree", "Makefile") 350 makefile = base_path_join(d.getVar("WORKDIR", True), "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: