summaryrefslogtreecommitdiffstats
path: root/meta/classes/insane.bbclass
diff options
context:
space:
mode:
authorOlof Johansson <olof.johansson@axis.com>2018-06-25 13:34:46 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-06-28 09:22:35 +0100
commit16f060c56f509ab1c4a77dfbe02d5cd77c977d54 (patch)
tree31c2cf88ff19d0926226cdf97dc4bf463ea55e02 /meta/classes/insane.bbclass
parentfed27b09454c8e84ffdd5e3da65d2aa71db01032 (diff)
downloadpoky-16f060c56f509ab1c4a77dfbe02d5cd77c977d54.tar.gz
insane.bbclass: Don't let warnings make previous errors non-fatal
package_qa_handle_error() returns True on non-fatal issues and False on fatal issues. But the current usage has been to do sane = package_qa_handle_error(...) which would always reset sanity status to be that of the last issue identified. This change the assignments to use the &= operator instead: sane &= package_qa_handle_error(...) As far as I can tell, this is not a real problem in practice, because warnings of different levels (WARN_QA, ERROR_QA) does not seem to have been mixed in a way that triggered this issue. (From OE-Core rev: 21d015f6c9927598d64c48c925638619b25cf232) Signed-off-by: Olof Johansson <olofjn@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/insane.bbclass')
-rw-r--r--meta/classes/insane.bbclass12
1 files changed, 6 insertions, 6 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index bdfdc315aa..713b40eac4 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -600,7 +600,7 @@ python populate_lic_qa_checksum() {
600 return 600 return
601 601
602 if not lic_files and d.getVar('SRC_URI'): 602 if not lic_files and d.getVar('SRC_URI'):
603 sane = package_qa_handle_error("license-checksum", pn + ": Recipe file fetches files and does not have license file information (LIC_FILES_CHKSUM)", d) 603 sane &= package_qa_handle_error("license-checksum", pn + ": Recipe file fetches files and does not have license file information (LIC_FILES_CHKSUM)", d)
604 604
605 srcdir = d.getVar('S') 605 srcdir = d.getVar('S')
606 corebase_licensefile = d.getVar('COREBASE') + "/LICENSE" 606 corebase_licensefile = d.getVar('COREBASE') + "/LICENSE"
@@ -608,11 +608,11 @@ python populate_lic_qa_checksum() {
608 try: 608 try:
609 (type, host, path, user, pswd, parm) = bb.fetch.decodeurl(url) 609 (type, host, path, user, pswd, parm) = bb.fetch.decodeurl(url)
610 except bb.fetch.MalformedUrl: 610 except bb.fetch.MalformedUrl:
611 sane = package_qa_handle_error("license-checksum", pn + ": LIC_FILES_CHKSUM contains an invalid URL: " + url, d) 611 sane &= package_qa_handle_error("license-checksum", pn + ": LIC_FILES_CHKSUM contains an invalid URL: " + url, d)
612 continue 612 continue
613 srclicfile = os.path.join(srcdir, path) 613 srclicfile = os.path.join(srcdir, path)
614 if not os.path.isfile(srclicfile): 614 if not os.path.isfile(srclicfile):
615 sane = package_qa_handle_error("license-checksum", pn + ": LIC_FILES_CHKSUM points to an invalid file: " + srclicfile, d) 615 sane &= package_qa_handle_error("license-checksum", pn + ": LIC_FILES_CHKSUM points to an invalid file: " + srclicfile, d)
616 continue 616 continue
617 617
618 if (srclicfile == corebase_licensefile): 618 if (srclicfile == corebase_licensefile):
@@ -696,7 +696,7 @@ python populate_lic_qa_checksum() {
696 else: 696 else:
697 msg = pn + ": LIC_FILES_CHKSUM is not specified for " + url 697 msg = pn + ": LIC_FILES_CHKSUM is not specified for " + url
698 msg = msg + "\n" + pn + ": The md5 checksum is " + md5chksum 698 msg = msg + "\n" + pn + ": The md5 checksum is " + md5chksum
699 sane = package_qa_handle_error("license-checksum", msg, d) 699 sane &= package_qa_handle_error("license-checksum", msg, d)
700 700
701 if not sane: 701 if not sane:
702 bb.fatal("Fatal QA errors found, failing task.") 702 bb.fatal("Fatal QA errors found, failing task.")
@@ -733,14 +733,14 @@ def package_qa_check_staged(path,d):
733 file_content = file_content.replace(recipesysroot, "") 733 file_content = file_content.replace(recipesysroot, "")
734 if workdir in file_content: 734 if workdir in file_content:
735 error_msg = "%s failed sanity test (workdir) in path %s" % (file,root) 735 error_msg = "%s failed sanity test (workdir) in path %s" % (file,root)
736 sane = package_qa_handle_error("la", error_msg, d) 736 sane &= package_qa_handle_error("la", error_msg, d)
737 elif file.endswith(".pc"): 737 elif file.endswith(".pc"):
738 with open(path) as f: 738 with open(path) as f:
739 file_content = f.read() 739 file_content = f.read()
740 file_content = file_content.replace(recipesysroot, "") 740 file_content = file_content.replace(recipesysroot, "")
741 if pkgconfigcheck in file_content: 741 if pkgconfigcheck in file_content:
742 error_msg = "%s failed sanity test (tmpdir) in path %s" % (file,root) 742 error_msg = "%s failed sanity test (tmpdir) in path %s" % (file,root)
743 sane = package_qa_handle_error("pkgconfig", error_msg, d) 743 sane &= package_qa_handle_error("pkgconfig", error_msg, d)
744 744
745 return sane 745 return sane
746 746