diff options
author | Joshua Lock <joshua.g.lock@intel.com> | 2016-12-14 21:13:04 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-12-16 10:23:23 +0000 |
commit | c4e2c59088765d1f1de7ec57cde91980f887c2ff (patch) | |
tree | a2fda8ac5916fb59a711e9220c2177008cca9347 /meta/classes/libc-package.bbclass | |
parent | d5e67725ac11e3296cad104470931ffa16824b90 (diff) | |
download | poky-c4e2c59088765d1f1de7ec57cde91980f887c2ff.tar.gz |
meta: remove True option to getVar calls
getVar() now defaults to expanding by default, thus remove the True
option from getVar() calls with a regex search and replace.
Search made with the following regex: getVar ?\(( ?[^,()]*), True\)
(From OE-Core rev: 7c552996597faaee2fbee185b250c0ee30ea3b5f)
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
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 | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/meta/classes/libc-package.bbclass b/meta/classes/libc-package.bbclass index 071978b519..739adce694 100644 --- a/meta/classes/libc-package.bbclass +++ b/meta/classes/libc-package.bbclass | |||
@@ -12,24 +12,24 @@ GLIBC_INTERNAL_USE_BINARY_LOCALE ?= "ondevice" | |||
12 | GLIBC_SPLIT_LC_PACKAGES ?= "0" | 12 | GLIBC_SPLIT_LC_PACKAGES ?= "0" |
13 | 13 | ||
14 | python __anonymous () { | 14 | python __anonymous () { |
15 | enabled = d.getVar("ENABLE_BINARY_LOCALE_GENERATION", True) | 15 | enabled = d.getVar("ENABLE_BINARY_LOCALE_GENERATION") |
16 | 16 | ||
17 | pn = d.getVar("PN", True) | 17 | pn = d.getVar("PN") |
18 | if pn.endswith("-initial"): | 18 | if pn.endswith("-initial"): |
19 | enabled = False | 19 | enabled = False |
20 | 20 | ||
21 | if enabled and int(enabled): | 21 | if enabled and int(enabled): |
22 | import re | 22 | import re |
23 | 23 | ||
24 | target_arch = d.getVar("TARGET_ARCH", True) | 24 | target_arch = d.getVar("TARGET_ARCH") |
25 | binary_arches = d.getVar("BINARY_LOCALE_ARCHES", True) or "" | 25 | binary_arches = d.getVar("BINARY_LOCALE_ARCHES") or "" |
26 | use_cross_localedef = d.getVar("LOCALE_GENERATION_WITH_CROSS-LOCALEDEF", True) or "" | 26 | use_cross_localedef = d.getVar("LOCALE_GENERATION_WITH_CROSS-LOCALEDEF") or "" |
27 | 27 | ||
28 | for regexp in binary_arches.split(" "): | 28 | for regexp in binary_arches.split(" "): |
29 | r = re.compile(regexp) | 29 | r = re.compile(regexp) |
30 | 30 | ||
31 | if r.match(target_arch): | 31 | if r.match(target_arch): |
32 | depends = d.getVar("DEPENDS", True) | 32 | depends = d.getVar("DEPENDS") |
33 | if use_cross_localedef == "1" : | 33 | if use_cross_localedef == "1" : |
34 | depends = "%s cross-localedef-native" % depends | 34 | depends = "%s cross-localedef-native" % depends |
35 | else: | 35 | else: |
@@ -94,21 +94,21 @@ inherit qemu | |||
94 | 94 | ||
95 | python package_do_split_gconvs () { | 95 | python package_do_split_gconvs () { |
96 | import re | 96 | import re |
97 | if (d.getVar('PACKAGE_NO_GCONV', True) == '1'): | 97 | if (d.getVar('PACKAGE_NO_GCONV') == '1'): |
98 | bb.note("package requested not splitting gconvs") | 98 | bb.note("package requested not splitting gconvs") |
99 | return | 99 | return |
100 | 100 | ||
101 | if not d.getVar('PACKAGES', True): | 101 | if not d.getVar('PACKAGES'): |
102 | return | 102 | return |
103 | 103 | ||
104 | mlprefix = d.getVar("MLPREFIX", True) or "" | 104 | mlprefix = d.getVar("MLPREFIX") or "" |
105 | 105 | ||
106 | bpn = d.getVar('BPN', True) | 106 | bpn = d.getVar('BPN') |
107 | libdir = d.getVar('libdir', True) | 107 | libdir = d.getVar('libdir') |
108 | if not libdir: | 108 | if not libdir: |
109 | bb.error("libdir not defined") | 109 | bb.error("libdir not defined") |
110 | return | 110 | return |
111 | datadir = d.getVar('datadir', True) | 111 | datadir = d.getVar('datadir') |
112 | if not datadir: | 112 | if not datadir: |
113 | bb.error("datadir not defined") | 113 | bb.error("datadir not defined") |
114 | return | 114 | return |
@@ -116,7 +116,7 @@ python package_do_split_gconvs () { | |||
116 | gconv_libdir = base_path_join(libdir, "gconv") | 116 | gconv_libdir = base_path_join(libdir, "gconv") |
117 | charmap_dir = base_path_join(datadir, "i18n", "charmaps") | 117 | charmap_dir = base_path_join(datadir, "i18n", "charmaps") |
118 | locales_dir = base_path_join(datadir, "i18n", "locales") | 118 | locales_dir = base_path_join(datadir, "i18n", "locales") |
119 | binary_locales_dir = d.getVar('localedir', True) | 119 | binary_locales_dir = d.getVar('localedir') |
120 | 120 | ||
121 | def calc_gconv_deps(fn, pkg, file_regex, output_pattern, group): | 121 | def calc_gconv_deps(fn, pkg, file_regex, output_pattern, group): |
122 | deps = [] | 122 | deps = [] |
@@ -183,13 +183,13 @@ python package_do_split_gconvs () { | |||
183 | description='locale definition for %s', hook=calc_locale_deps, extra_depends='') | 183 | description='locale definition for %s', hook=calc_locale_deps, extra_depends='') |
184 | d.setVar('PACKAGES', d.getVar('PACKAGES', False) + ' ' + d.getVar('MLPREFIX', False) + bpn + '-gconv') | 184 | d.setVar('PACKAGES', d.getVar('PACKAGES', False) + ' ' + d.getVar('MLPREFIX', False) + bpn + '-gconv') |
185 | 185 | ||
186 | use_bin = d.getVar("GLIBC_INTERNAL_USE_BINARY_LOCALE", True) | 186 | use_bin = d.getVar("GLIBC_INTERNAL_USE_BINARY_LOCALE") |
187 | 187 | ||
188 | dot_re = re.compile("(.*)\.(.*)") | 188 | dot_re = re.compile("(.*)\.(.*)") |
189 | 189 | ||
190 | # Read in supported locales and associated encodings | 190 | # Read in supported locales and associated encodings |
191 | supported = {} | 191 | supported = {} |
192 | with open(base_path_join(d.getVar('WORKDIR', True), "SUPPORTED")) as f: | 192 | with open(base_path_join(d.getVar('WORKDIR'), "SUPPORTED")) as f: |
193 | for line in f.readlines(): | 193 | for line in f.readlines(): |
194 | try: | 194 | try: |
195 | locale, charset = line.rstrip().split() | 195 | locale, charset = line.rstrip().split() |
@@ -198,7 +198,7 @@ python package_do_split_gconvs () { | |||
198 | supported[locale] = charset | 198 | supported[locale] = charset |
199 | 199 | ||
200 | # GLIBC_GENERATE_LOCALES var specifies which locales to be generated. empty or "all" means all locales | 200 | # GLIBC_GENERATE_LOCALES var specifies which locales to be generated. empty or "all" means all locales |
201 | to_generate = d.getVar('GLIBC_GENERATE_LOCALES', True) | 201 | to_generate = d.getVar('GLIBC_GENERATE_LOCALES') |
202 | if not to_generate or to_generate == 'all': | 202 | if not to_generate or to_generate == 'all': |
203 | to_generate = sorted(supported.keys()) | 203 | to_generate = sorted(supported.keys()) |
204 | else: | 204 | else: |
@@ -215,14 +215,14 @@ python package_do_split_gconvs () { | |||
215 | def output_locale_source(name, pkgname, locale, encoding): | 215 | def output_locale_source(name, pkgname, locale, encoding): |
216 | d.setVar('RDEPENDS_%s' % pkgname, '%slocaledef %s-localedata-%s %s-charmap-%s' % \ | 216 | d.setVar('RDEPENDS_%s' % pkgname, '%slocaledef %s-localedata-%s %s-charmap-%s' % \ |
217 | (mlprefix, mlprefix+bpn, legitimize_package_name(locale), mlprefix+bpn, legitimize_package_name(encoding))) | 217 | (mlprefix, mlprefix+bpn, legitimize_package_name(locale), mlprefix+bpn, legitimize_package_name(encoding))) |
218 | d.setVar('pkg_postinst_%s' % pkgname, d.getVar('locale_base_postinst', True) \ | 218 | d.setVar('pkg_postinst_%s' % pkgname, d.getVar('locale_base_postinst') \ |
219 | % (locale, encoding, locale)) | 219 | % (locale, encoding, locale)) |
220 | d.setVar('pkg_postrm_%s' % pkgname, d.getVar('locale_base_postrm', True) % \ | 220 | d.setVar('pkg_postrm_%s' % pkgname, d.getVar('locale_base_postrm') % \ |
221 | (locale, encoding, locale)) | 221 | (locale, encoding, locale)) |
222 | 222 | ||
223 | def output_locale_binary_rdepends(name, pkgname, locale, encoding): | 223 | def output_locale_binary_rdepends(name, pkgname, locale, encoding): |
224 | dep = legitimize_package_name('%s-binary-localedata-%s' % (bpn, name)) | 224 | dep = legitimize_package_name('%s-binary-localedata-%s' % (bpn, name)) |
225 | lcsplit = d.getVar('GLIBC_SPLIT_LC_PACKAGES', True) | 225 | lcsplit = d.getVar('GLIBC_SPLIT_LC_PACKAGES') |
226 | if lcsplit and int(lcsplit): | 226 | if lcsplit and int(lcsplit): |
227 | d.appendVar('PACKAGES', ' ' + dep) | 227 | d.appendVar('PACKAGES', ' ' + dep) |
228 | d.setVar('ALLOW_EMPTY_%s' % dep, '1') | 228 | d.setVar('ALLOW_EMPTY_%s' % dep, '1') |
@@ -231,16 +231,16 @@ python package_do_split_gconvs () { | |||
231 | commands = {} | 231 | commands = {} |
232 | 232 | ||
233 | def output_locale_binary(name, pkgname, locale, encoding): | 233 | def output_locale_binary(name, pkgname, locale, encoding): |
234 | treedir = base_path_join(d.getVar("WORKDIR", True), "locale-tree") | 234 | treedir = base_path_join(d.getVar("WORKDIR"), "locale-tree") |
235 | ldlibdir = base_path_join(treedir, d.getVar("base_libdir", True)) | 235 | ldlibdir = base_path_join(treedir, d.getVar("base_libdir")) |
236 | path = d.getVar("PATH", True) | 236 | path = d.getVar("PATH") |
237 | i18npath = base_path_join(treedir, datadir, "i18n") | 237 | i18npath = base_path_join(treedir, datadir, "i18n") |
238 | gconvpath = base_path_join(treedir, "iconvdata") | 238 | gconvpath = base_path_join(treedir, "iconvdata") |
239 | outputpath = base_path_join(treedir, binary_locales_dir) | 239 | outputpath = base_path_join(treedir, binary_locales_dir) |
240 | 240 | ||
241 | use_cross_localedef = d.getVar("LOCALE_GENERATION_WITH_CROSS-LOCALEDEF", True) or "0" | 241 | use_cross_localedef = d.getVar("LOCALE_GENERATION_WITH_CROSS-LOCALEDEF") or "0" |
242 | if use_cross_localedef == "1": | 242 | if use_cross_localedef == "1": |
243 | target_arch = d.getVar('TARGET_ARCH', True) | 243 | target_arch = d.getVar('TARGET_ARCH') |
244 | locale_arch_options = { \ | 244 | locale_arch_options = { \ |
245 | "arm": " --uint32-align=4 --little-endian ", \ | 245 | "arm": " --uint32-align=4 --little-endian ", \ |
246 | "armeb": " --uint32-align=4 --big-endian ", \ | 246 | "armeb": " --uint32-align=4 --big-endian ", \ |
@@ -279,7 +279,7 @@ python package_do_split_gconvs () { | |||
279 | --inputfile=%s/i18n/locales/%s --charmap=%s %s" \ | 279 | --inputfile=%s/i18n/locales/%s --charmap=%s %s" \ |
280 | % (treedir, datadir, locale, encoding, name) | 280 | % (treedir, datadir, locale, encoding, name) |
281 | 281 | ||
282 | qemu_options = d.getVar('QEMU_OPTIONS', True) | 282 | qemu_options = d.getVar('QEMU_OPTIONS') |
283 | 283 | ||
284 | cmd = "PSEUDO_RELOADED=YES PATH=\"%s\" I18NPATH=\"%s\" %s -L %s \ | 284 | cmd = "PSEUDO_RELOADED=YES PATH=\"%s\" I18NPATH=\"%s\" %s -L %s \ |
285 | -E LD_LIBRARY_PATH=%s %s %s/bin/localedef %s" % \ | 285 | -E LD_LIBRARY_PATH=%s %s %s/bin/localedef %s" % \ |
@@ -292,7 +292,7 @@ python package_do_split_gconvs () { | |||
292 | def output_locale(name, locale, encoding): | 292 | def output_locale(name, locale, encoding): |
293 | pkgname = d.getVar('MLPREFIX', False) + 'locale-base-' + legitimize_package_name(name) | 293 | pkgname = d.getVar('MLPREFIX', False) + 'locale-base-' + legitimize_package_name(name) |
294 | d.setVar('ALLOW_EMPTY_%s' % pkgname, '1') | 294 | d.setVar('ALLOW_EMPTY_%s' % pkgname, '1') |
295 | d.setVar('PACKAGES', '%s %s' % (pkgname, d.getVar('PACKAGES', True))) | 295 | d.setVar('PACKAGES', '%s %s' % (pkgname, d.getVar('PACKAGES'))) |
296 | rprovides = ' %svirtual-locale-%s' % (mlprefix, legitimize_package_name(name)) | 296 | rprovides = ' %svirtual-locale-%s' % (mlprefix, legitimize_package_name(name)) |
297 | m = re.match("(.*)_(.*)", name) | 297 | m = re.match("(.*)_(.*)", name) |
298 | if m: | 298 | if m: |
@@ -311,8 +311,8 @@ python package_do_split_gconvs () { | |||
311 | bb.note("preparing tree for binary locale generation") | 311 | bb.note("preparing tree for binary locale generation") |
312 | bb.build.exec_func("do_prep_locale_tree", d) | 312 | bb.build.exec_func("do_prep_locale_tree", d) |
313 | 313 | ||
314 | utf8_only = int(d.getVar('LOCALE_UTF8_ONLY', True) or 0) | 314 | utf8_only = int(d.getVar('LOCALE_UTF8_ONLY') or 0) |
315 | utf8_is_default = int(d.getVar('LOCALE_UTF8_IS_DEFAULT', True) or 0) | 315 | utf8_is_default = int(d.getVar('LOCALE_UTF8_IS_DEFAULT') or 0) |
316 | 316 | ||
317 | encodings = {} | 317 | encodings = {} |
318 | for locale in to_generate: | 318 | for locale in to_generate: |
@@ -344,7 +344,7 @@ python package_do_split_gconvs () { | |||
344 | d.appendVar('RDEPENDS_%s' % metapkg, ' ' + pkg) | 344 | d.appendVar('RDEPENDS_%s' % metapkg, ' ' + pkg) |
345 | 345 | ||
346 | if use_bin == "compile": | 346 | if use_bin == "compile": |
347 | makefile = base_path_join(d.getVar("WORKDIR", True), "locale-tree", "Makefile") | 347 | makefile = base_path_join(d.getVar("WORKDIR"), "locale-tree", "Makefile") |
348 | m = open(makefile, "w") | 348 | m = open(makefile, "w") |
349 | m.write("all: %s\n\n" % " ".join(commands.keys())) | 349 | m.write("all: %s\n\n" % " ".join(commands.keys())) |
350 | for cmd in commands: | 350 | for cmd in commands: |
@@ -358,7 +358,7 @@ python package_do_split_gconvs () { | |||
358 | bb.build.exec_func("do_collect_bins_from_locale_tree", d) | 358 | bb.build.exec_func("do_collect_bins_from_locale_tree", d) |
359 | 359 | ||
360 | if use_bin in ('compile', 'precompiled'): | 360 | if use_bin in ('compile', 'precompiled'): |
361 | lcsplit = d.getVar('GLIBC_SPLIT_LC_PACKAGES', True) | 361 | lcsplit = d.getVar('GLIBC_SPLIT_LC_PACKAGES') |
362 | if lcsplit and int(lcsplit): | 362 | if lcsplit and int(lcsplit): |
363 | do_split_packages(d, binary_locales_dir, file_regex='^(.*/LC_\w+)', \ | 363 | do_split_packages(d, binary_locales_dir, file_regex='^(.*/LC_\w+)', \ |
364 | output_pattern=bpn+'-binary-localedata-%s', \ | 364 | output_pattern=bpn+'-binary-localedata-%s', \ |