diff options
Diffstat (limited to 'meta/classes/insane.bbclass')
-rw-r--r-- | meta/classes/insane.bbclass | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass index 809aa457a1..4d2392e908 100644 --- a/meta/classes/insane.bbclass +++ b/meta/classes/insane.bbclass | |||
@@ -518,9 +518,10 @@ def package_qa_check_buildpaths(path, name, d, elf, messages): | |||
518 | return | 518 | return |
519 | 519 | ||
520 | tmpdir = d.getVar('TMPDIR', True) | 520 | tmpdir = d.getVar('TMPDIR', True) |
521 | file_content = open(path).read() | 521 | with open(path) as f: |
522 | if tmpdir in file_content: | 522 | file_content = f.read() |
523 | messages.append("File %s in package contained reference to tmpdir" % package_qa_clean_path(path,d)) | 523 | if tmpdir in file_content: |
524 | messages.append("File %s in package contained reference to tmpdir" % package_qa_clean_path(path,d)) | ||
524 | 525 | ||
525 | 526 | ||
526 | QAPATHTEST[xorg-driver-abi] = "package_qa_check_xorg_driver_abi" | 527 | QAPATHTEST[xorg-driver-abi] = "package_qa_check_xorg_driver_abi" |
@@ -634,15 +635,17 @@ def package_qa_check_staged(path,d): | |||
634 | for file in files: | 635 | for file in files: |
635 | path = os.path.join(root,file) | 636 | path = os.path.join(root,file) |
636 | if file.endswith(".la"): | 637 | if file.endswith(".la"): |
637 | file_content = open(path).read() | 638 | with open(path) as f: |
638 | if workdir in file_content: | 639 | file_content = f.read() |
639 | error_msg = "%s failed sanity test (workdir) in path %s" % (file,root) | 640 | if workdir in file_content: |
640 | sane = package_qa_handle_error("la", error_msg, d) | 641 | error_msg = "%s failed sanity test (workdir) in path %s" % (file,root) |
642 | sane = package_qa_handle_error("la", error_msg, d) | ||
641 | elif file.endswith(".pc"): | 643 | elif file.endswith(".pc"): |
642 | file_content = open(path).read() | 644 | with open(path) as f: |
643 | if pkgconfigcheck in file_content: | 645 | file_content = f.read() |
644 | error_msg = "%s failed sanity test (tmpdir) in path %s" % (file,root) | 646 | if pkgconfigcheck in file_content: |
645 | sane = package_qa_handle_error("pkgconfig", error_msg, d) | 647 | error_msg = "%s failed sanity test (tmpdir) in path %s" % (file,root) |
648 | sane = package_qa_handle_error("pkgconfig", error_msg, d) | ||
646 | 649 | ||
647 | return sane | 650 | return sane |
648 | 651 | ||