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/insane.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/insane.bbclass')
-rw-r--r-- | meta/classes/insane.bbclass | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass index 017f7bedc6..a65f3ee865 100644 --- a/meta/classes/insane.bbclass +++ b/meta/classes/insane.bbclass | |||
@@ -105,7 +105,7 @@ ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch la2 pkgconfig la perms" | |||
105 | 105 | ||
106 | def package_qa_clean_path(path,d): | 106 | def package_qa_clean_path(path,d): |
107 | """ Remove the common prefix from the path. In this case it is the TMPDIR""" | 107 | """ Remove the common prefix from the path. In this case it is the TMPDIR""" |
108 | return path.replace(bb.data.getVar('TMPDIR',d,True),"") | 108 | return path.replace(d.getVar('TMPDIR',True),"") |
109 | 109 | ||
110 | def package_qa_write_error(error, d): | 110 | def package_qa_write_error(error, d): |
111 | logfile = d.getVar('QA_LOGFILE', True) | 111 | logfile = d.getVar('QA_LOGFILE', True) |
@@ -132,13 +132,13 @@ def package_qa_check_rpath(file,name, d, elf, messages): | |||
132 | if not elf: | 132 | if not elf: |
133 | return | 133 | return |
134 | 134 | ||
135 | scanelf = os.path.join(bb.data.getVar('STAGING_BINDIR_NATIVE',d,True),'scanelf') | 135 | scanelf = os.path.join(d.getVar('STAGING_BINDIR_NATIVE',True),'scanelf') |
136 | bad_dirs = [bb.data.getVar('TMPDIR', d, True) + "/work", bb.data.getVar('STAGING_DIR_TARGET', d, True)] | 136 | bad_dirs = [d.getVar('TMPDIR', True) + "/work", d.getVar('STAGING_DIR_TARGET', True)] |
137 | bad_dir_test = bb.data.getVar('TMPDIR', d, True) | 137 | bad_dir_test = d.getVar('TMPDIR', True) |
138 | if not os.path.exists(scanelf): | 138 | if not os.path.exists(scanelf): |
139 | bb.fatal("Can not check RPATH, scanelf (part of pax-utils-native) not found") | 139 | bb.fatal("Can not check RPATH, scanelf (part of pax-utils-native) not found") |
140 | 140 | ||
141 | if not bad_dirs[0] in bb.data.getVar('WORKDIR', d, True): | 141 | if not bad_dirs[0] in d.getVar('WORKDIR', True): |
142 | bb.fatal("This class assumed that WORKDIR is ${TMPDIR}/work... Not doing any check") | 142 | bb.fatal("This class assumed that WORKDIR is ${TMPDIR}/work... Not doing any check") |
143 | 143 | ||
144 | output = os.popen("%s -B -F%%r#F '%s'" % (scanelf,file)) | 144 | output = os.popen("%s -B -F%%r#F '%s'" % (scanelf,file)) |
@@ -156,11 +156,11 @@ def package_qa_check_useless_rpaths(file, name, d, elf, messages): | |||
156 | if not elf: | 156 | if not elf: |
157 | return | 157 | return |
158 | 158 | ||
159 | objdump = bb.data.getVar('OBJDUMP', d, True) | 159 | objdump = d.getVar('OBJDUMP', True) |
160 | env_path = bb.data.getVar('PATH', d, True) | 160 | env_path = d.getVar('PATH', True) |
161 | 161 | ||
162 | libdir = bb.data.getVar("libdir", d, True) | 162 | libdir = d.getVar("libdir", True) |
163 | base_libdir = bb.data.getVar("base_libdir", d, True) | 163 | base_libdir = d.getVar("base_libdir", True) |
164 | 164 | ||
165 | import re | 165 | import re |
166 | rpath_re = re.compile("\s+RPATH\s+(.*)") | 166 | rpath_re = re.compile("\s+RPATH\s+(.*)") |
@@ -209,8 +209,8 @@ def package_qa_check_arch(path,name,d, elf, messages): | |||
209 | if not elf: | 209 | if not elf: |
210 | return | 210 | return |
211 | 211 | ||
212 | target_os = bb.data.getVar('TARGET_OS', d, True) | 212 | target_os = d.getVar('TARGET_OS', True) |
213 | target_arch = bb.data.getVar('TARGET_ARCH', d, True) | 213 | target_arch = d.getVar('TARGET_ARCH', True) |
214 | 214 | ||
215 | # FIXME: Cross package confuse this check, so just skip them | 215 | # FIXME: Cross package confuse this check, so just skip them |
216 | for s in ['cross', 'nativesdk', 'cross-canadian']: | 216 | for s in ['cross', 'nativesdk', 'cross-canadian']: |
@@ -243,7 +243,7 @@ def package_qa_check_desktop(path, name, d, elf, messages): | |||
243 | Run all desktop files through desktop-file-validate. | 243 | Run all desktop files through desktop-file-validate. |
244 | """ | 244 | """ |
245 | if path.endswith(".desktop"): | 245 | if path.endswith(".desktop"): |
246 | desktop_file_validate = os.path.join(bb.data.getVar('STAGING_BINDIR_NATIVE',d,True),'desktop-file-validate') | 246 | desktop_file_validate = os.path.join(d.getVar('STAGING_BINDIR_NATIVE',True),'desktop-file-validate') |
247 | output = os.popen("%s %s" % (desktop_file_validate, path)) | 247 | output = os.popen("%s %s" % (desktop_file_validate, path)) |
248 | # This only produces output on errors | 248 | # This only produces output on errors |
249 | for l in output: | 249 | for l in output: |
@@ -261,14 +261,14 @@ def package_qa_hash_style(path, name, d, elf, messages): | |||
261 | if os.path.islink(path): | 261 | if os.path.islink(path): |
262 | return | 262 | return |
263 | 263 | ||
264 | gnu_hash = "--hash-style=gnu" in bb.data.getVar('LDFLAGS', d, True) | 264 | gnu_hash = "--hash-style=gnu" in d.getVar('LDFLAGS', True) |
265 | if not gnu_hash: | 265 | if not gnu_hash: |
266 | gnu_hash = "--hash-style=both" in bb.data.getVar('LDFLAGS', d, True) | 266 | gnu_hash = "--hash-style=both" in d.getVar('LDFLAGS', True) |
267 | if not gnu_hash: | 267 | if not gnu_hash: |
268 | return | 268 | return |
269 | 269 | ||
270 | objdump = bb.data.getVar('OBJDUMP', d, True) | 270 | objdump = d.getVar('OBJDUMP', True) |
271 | env_path = bb.data.getVar('PATH', d, True) | 271 | env_path = d.getVar('PATH', True) |
272 | 272 | ||
273 | sane = False | 273 | sane = False |
274 | has_syms = False | 274 | has_syms = False |
@@ -299,7 +299,7 @@ def package_qa_check_buildpaths(path, name, d, elf, messages): | |||
299 | if os.path.islink(path): | 299 | if os.path.islink(path): |
300 | return | 300 | return |
301 | 301 | ||
302 | tmpdir = bb.data.getVar('TMPDIR', d, True) | 302 | tmpdir = d.getVar('TMPDIR', True) |
303 | file_content = open(path).read() | 303 | file_content = open(path).read() |
304 | if tmpdir in file_content: | 304 | if tmpdir in file_content: |
305 | messages.append("File %s in package contained reference to tmpdir" % package_qa_clean_path(path,d)) | 305 | messages.append("File %s in package contained reference to tmpdir" % package_qa_clean_path(path,d)) |
@@ -311,9 +311,9 @@ def package_qa_check_license(workdir, d): | |||
311 | import tempfile | 311 | import tempfile |
312 | sane = True | 312 | sane = True |
313 | 313 | ||
314 | lic_files = bb.data.getVar('LIC_FILES_CHKSUM', d, True) | 314 | lic_files = d.getVar('LIC_FILES_CHKSUM', True) |
315 | lic = bb.data.getVar('LICENSE', d, True) | 315 | lic = d.getVar('LICENSE', True) |
316 | pn = bb.data.getVar('PN', d, True) | 316 | pn = d.getVar('PN', True) |
317 | 317 | ||
318 | if lic == "CLOSED": | 318 | if lic == "CLOSED": |
319 | return True | 319 | return True |
@@ -324,7 +324,7 @@ def package_qa_check_license(workdir, d): | |||
324 | bb.error(pn + ": Recipe file does not have license file information (LIC_FILES_CHKSUM)") | 324 | bb.error(pn + ": Recipe file does not have license file information (LIC_FILES_CHKSUM)") |
325 | return False | 325 | return False |
326 | 326 | ||
327 | srcdir = bb.data.getVar('S', d, True) | 327 | srcdir = d.getVar('S', True) |
328 | 328 | ||
329 | for url in lic_files.split(): | 329 | for url in lic_files.split(): |
330 | (type, host, path, user, pswd, parm) = bb.decodeurl(url) | 330 | (type, host, path, user, pswd, parm) = bb.decodeurl(url) |
@@ -384,7 +384,7 @@ def package_qa_check_staged(path,d): | |||
384 | """ | 384 | """ |
385 | 385 | ||
386 | sane = True | 386 | sane = True |
387 | tmpdir = bb.data.getVar('TMPDIR', d, True) | 387 | tmpdir = d.getVar('TMPDIR', True) |
388 | workdir = os.path.join(tmpdir, "work") | 388 | workdir = os.path.join(tmpdir, "work") |
389 | 389 | ||
390 | installed = "installed=yes" | 390 | installed = "installed=yes" |
@@ -417,8 +417,8 @@ def package_qa_walk(path, warnfuncs, errorfuncs, skip, package, d): | |||
417 | import oe.qa | 417 | import oe.qa |
418 | 418 | ||
419 | #if this will throw an exception, then fix the dict above | 419 | #if this will throw an exception, then fix the dict above |
420 | target_os = bb.data.getVar('TARGET_OS', d, True) | 420 | target_os = d.getVar('TARGET_OS', True) |
421 | target_arch = bb.data.getVar('TARGET_ARCH', d, True) | 421 | target_arch = d.getVar('TARGET_ARCH', True) |
422 | 422 | ||
423 | warnings = [] | 423 | warnings = [] |
424 | errors = [] | 424 | errors = [] |
@@ -457,19 +457,19 @@ def package_qa_check_rdepends(pkg, pkgdest, skip, d): | |||
457 | localdata = bb.data.createCopy(d) | 457 | localdata = bb.data.createCopy(d) |
458 | root = "%s/%s" % (pkgdest, pkg) | 458 | root = "%s/%s" % (pkgdest, pkg) |
459 | 459 | ||
460 | bb.data.setVar('ROOT', '', localdata) | 460 | localdata.setVar('ROOT', '') |
461 | bb.data.setVar('ROOT_%s' % pkg, root, localdata) | 461 | localdata.setVar('ROOT_%s' % pkg, root) |
462 | pkgname = bb.data.getVar('PKG_%s' % pkg, localdata, True) | 462 | pkgname = localdata.getVar('PKG_%s' % pkg, True) |
463 | if not pkgname: | 463 | if not pkgname: |
464 | pkgname = pkg | 464 | pkgname = pkg |
465 | bb.data.setVar('PKG', pkgname, localdata) | 465 | localdata.setVar('PKG', pkgname) |
466 | 466 | ||
467 | bb.data.setVar('OVERRIDES', pkg, localdata) | 467 | localdata.setVar('OVERRIDES', pkg) |
468 | 468 | ||
469 | bb.data.update_data(localdata) | 469 | bb.data.update_data(localdata) |
470 | 470 | ||
471 | # Now check the RDEPENDS | 471 | # Now check the RDEPENDS |
472 | rdepends = bb.utils.explode_deps(bb.data.getVar('RDEPENDS', localdata, True) or "") | 472 | rdepends = bb.utils.explode_deps(localdata.getVar('RDEPENDS', True) or "") |
473 | 473 | ||
474 | 474 | ||
475 | # Now do the sanity check!!! | 475 | # Now do the sanity check!!! |
@@ -487,8 +487,8 @@ def package_qa_check_rdepends(pkg, pkgdest, skip, d): | |||
487 | python do_package_qa () { | 487 | python do_package_qa () { |
488 | bb.note("DO PACKAGE QA") | 488 | bb.note("DO PACKAGE QA") |
489 | 489 | ||
490 | logdir = bb.data.getVar('T', d, True) | 490 | logdir = d.getVar('T', True) |
491 | pkg = bb.data.getVar('PN', d, True) | 491 | pkg = d.getVar('PN', True) |
492 | 492 | ||
493 | # Check the compile log for host contamination | 493 | # Check the compile log for host contamination |
494 | compilelog = os.path.join(logdir,"log.do_compile") | 494 | compilelog = os.path.join(logdir,"log.do_compile") |
@@ -508,8 +508,8 @@ python do_package_qa () { | |||
508 | (pkg, installlog)) | 508 | (pkg, installlog)) |
509 | 509 | ||
510 | # Scan the packages... | 510 | # Scan the packages... |
511 | pkgdest = bb.data.getVar('PKGDEST', d, True) | 511 | pkgdest = d.getVar('PKGDEST', True) |
512 | packages = bb.data.getVar('PACKAGES',d, True) | 512 | packages = d.getVar('PACKAGES', True) |
513 | 513 | ||
514 | # no packages should be scanned | 514 | # no packages should be scanned |
515 | if not packages: | 515 | if not packages: |
@@ -521,7 +521,7 @@ python do_package_qa () { | |||
521 | walk_sane = True | 521 | walk_sane = True |
522 | rdepends_sane = True | 522 | rdepends_sane = True |
523 | for package in packages.split(): | 523 | for package in packages.split(): |
524 | skip = (bb.data.getVar('INSANE_SKIP_' + package, d, True) or "").split() | 524 | skip = (d.getVar('INSANE_SKIP_' + package, True) or "").split() |
525 | if skip: | 525 | if skip: |
526 | bb.note("Package %s skipping QA tests: %s" % (package, str(skip))) | 526 | bb.note("Package %s skipping QA tests: %s" % (package, str(skip))) |
527 | warnchecks = [] | 527 | warnchecks = [] |
@@ -560,7 +560,7 @@ python do_qa_staging() { | |||
560 | 560 | ||
561 | python do_qa_configure() { | 561 | python do_qa_configure() { |
562 | configs = [] | 562 | configs = [] |
563 | workdir = bb.data.getVar('WORKDIR', d, True) | 563 | workdir = d.getVar('WORKDIR', True) |
564 | bb.note("Checking autotools environment for common misconfiguration") | 564 | bb.note("Checking autotools environment for common misconfiguration") |
565 | for root, dirs, files in os.walk(workdir): | 565 | for root, dirs, files in os.walk(workdir): |
566 | statement = "grep -e 'CROSS COMPILE Badness:' -e 'is unsafe for cross-compilation' %s > /dev/null" % \ | 566 | statement = "grep -e 'CROSS COMPILE Badness:' -e 'is unsafe for cross-compilation' %s > /dev/null" % \ |
@@ -575,8 +575,8 @@ Rerun configure task after fixing this. The path was '%s'""" % root) | |||
575 | if "configure.in" in files: | 575 | if "configure.in" in files: |
576 | configs.append(os.path.join(root, "configure.in")) | 576 | configs.append(os.path.join(root, "configure.in")) |
577 | 577 | ||
578 | cnf = bb.data.getVar('EXTRA_OECONF', d, True) or "" | 578 | cnf = d.getVar('EXTRA_OECONF', True) or "" |
579 | if "gettext" not in bb.data.getVar('P', d, True) and "gcc-runtime" not in bb.data.getVar('P', d, True) and "--disable-nls" not in cnf: | 579 | if "gettext" not in d.getVar('P', True) and "gcc-runtime" not in d.getVar('P', True) and "--disable-nls" not in cnf: |
580 | ml = d.getVar("MLPREFIX", True) or "" | 580 | ml = d.getVar("MLPREFIX", True) or "" |
581 | if bb.data.inherits_class('native', d) or bb.data.inherits_class('cross', d) or bb.data.inherits_class('crosssdk', d) or bb.data.inherits_class('nativesdk', d): | 581 | if bb.data.inherits_class('native', d) or bb.data.inherits_class('cross', d) or bb.data.inherits_class('crosssdk', d) or bb.data.inherits_class('nativesdk', d): |
582 | gt = "gettext-native" | 582 | gt = "gettext-native" |
@@ -584,7 +584,7 @@ Rerun configure task after fixing this. The path was '%s'""" % root) | |||
584 | gt = "gettext-nativesdk" | 584 | gt = "gettext-nativesdk" |
585 | else: | 585 | else: |
586 | gt = "virtual/" + ml + "gettext" | 586 | gt = "virtual/" + ml + "gettext" |
587 | deps = bb.utils.explode_deps(bb.data.getVar('DEPENDS', d, True) or "") | 587 | deps = bb.utils.explode_deps(d.getVar('DEPENDS', True) or "") |
588 | if gt not in deps: | 588 | if gt not in deps: |
589 | for config in configs: | 589 | for config in configs: |
590 | gnu = "grep \"^[[:space:]]*AM_GNU_GETTEXT\" %s >/dev/null" % config | 590 | gnu = "grep \"^[[:space:]]*AM_GNU_GETTEXT\" %s >/dev/null" % config |