diff options
author | Ross Burton <ross.burton@intel.com> | 2016-09-15 00:08:01 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-09-16 15:24:02 +0100 |
commit | cfe41123476089f98af4e40e2ea7d56d16499a79 (patch) | |
tree | f6ad6617f9cc11831c8e31f196238511c4469e6d /meta | |
parent | 2a2634e10debd81bb95fe7be5df92f89d67f80e2 (diff) | |
download | poky-cfe41123476089f98af4e40e2ea7d56d16499a79.tar.gz |
sanity: make license QA failures fatal again
Previous work to clean up the license QA code (oe-core fbdf977) had the side
effect that failing the license sanity check (bad or missing LIC_FILES_CHKSUM)
would emit an error message but wouldn't actually abort the build.
Solve this by changing populate_lic_qa_checksum() so that it tracks if the
message class was in ERROR_QA and if so, aborts the function.
[ YOCTO #10280 ]
(From OE-Core rev: 5ba1a7505b904a4aa2118fa9614d76df97597af8)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/insane.bbclass | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass index 67729445a9..2f3f768d58 100644 --- a/meta/classes/insane.bbclass +++ b/meta/classes/insane.bbclass | |||
@@ -690,7 +690,7 @@ def package_qa_check_symlink_to_sysroot(path, name, d, elf, messages): | |||
690 | do_populate_lic[postfuncs] += "populate_lic_qa_checksum" | 690 | do_populate_lic[postfuncs] += "populate_lic_qa_checksum" |
691 | python populate_lic_qa_checksum() { | 691 | python populate_lic_qa_checksum() { |
692 | """ | 692 | """ |
693 | Check for changes in the license files | 693 | Check for changes in the license files. |
694 | """ | 694 | """ |
695 | import tempfile | 695 | import tempfile |
696 | sane = True | 696 | sane = True |
@@ -703,8 +703,7 @@ python populate_lic_qa_checksum() { | |||
703 | return | 703 | return |
704 | 704 | ||
705 | if not lic_files and d.getVar('SRC_URI', True): | 705 | if not lic_files and d.getVar('SRC_URI', True): |
706 | package_qa_handle_error("license-checksum", pn + ": Recipe file fetches files and does not have license file information (LIC_FILES_CHKSUM)", d) | 706 | sane = package_qa_handle_error("license-checksum", pn + ": Recipe file fetches files and does not have license file information (LIC_FILES_CHKSUM)", d) |
707 | return | ||
708 | 707 | ||
709 | srcdir = d.getVar('S', True) | 708 | srcdir = d.getVar('S', True) |
710 | 709 | ||
@@ -712,7 +711,7 @@ python populate_lic_qa_checksum() { | |||
712 | try: | 711 | try: |
713 | (type, host, path, user, pswd, parm) = bb.fetch.decodeurl(url) | 712 | (type, host, path, user, pswd, parm) = bb.fetch.decodeurl(url) |
714 | except bb.fetch.MalformedUrl: | 713 | except bb.fetch.MalformedUrl: |
715 | package_qa_handle_error("license-checksum", pn + ": LIC_FILES_CHKSUM contains an invalid URL: " + url, d) | 714 | sane = package_qa_handle_error("license-checksum", pn + ": LIC_FILES_CHKSUM contains an invalid URL: " + url, d) |
716 | continue | 715 | continue |
717 | srclicfile = os.path.join(srcdir, path) | 716 | srclicfile = os.path.join(srcdir, path) |
718 | if not os.path.isfile(srclicfile): | 717 | if not os.path.isfile(srclicfile): |
@@ -736,7 +735,7 @@ python populate_lic_qa_checksum() { | |||
736 | linesout = 0 | 735 | linesout = 0 |
737 | for line in fi: | 736 | for line in fi: |
738 | lineno += 1 | 737 | lineno += 1 |
739 | if (lineno >= beginline): | 738 | if (lineno >= beginline): |
740 | if ((lineno <= endline) or not endline): | 739 | if ((lineno <= endline) or not endline): |
741 | fo.write(line) | 740 | fo.write(line) |
742 | linesout += 1 | 741 | linesout += 1 |
@@ -768,7 +767,10 @@ python populate_lic_qa_checksum() { | |||
768 | else: | 767 | else: |
769 | msg = pn + ": LIC_FILES_CHKSUM is not specified for " + url | 768 | msg = pn + ": LIC_FILES_CHKSUM is not specified for " + url |
770 | msg = msg + "\n" + pn + ": The md5 checksum is " + md5chksum | 769 | msg = msg + "\n" + pn + ": The md5 checksum is " + md5chksum |
771 | package_qa_handle_error("license-checksum", msg, d) | 770 | sane = package_qa_handle_error("license-checksum", msg, d) |
771 | |||
772 | if not sane: | ||
773 | bb.fatal("Fatal QA errors found, failing task.") | ||
772 | } | 774 | } |
773 | 775 | ||
774 | def package_qa_check_staged(path,d): | 776 | def package_qa_check_staged(path,d): |