1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-30 12:29:55 +00:00

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>
This commit is contained in:
Ross Burton
2016-09-15 00:08:01 +01:00
committed by Richard Purdie
parent 2a2634e10d
commit cfe4112347
+7 -5
View File
@@ -690,7 +690,7 @@ def package_qa_check_symlink_to_sysroot(path, name, d, elf, messages):
do_populate_lic[postfuncs] += "populate_lic_qa_checksum" do_populate_lic[postfuncs] += "populate_lic_qa_checksum"
python populate_lic_qa_checksum() { python populate_lic_qa_checksum() {
""" """
Check for changes in the license files Check for changes in the license files.
""" """
import tempfile import tempfile
sane = True sane = True
@@ -703,8 +703,7 @@ python populate_lic_qa_checksum() {
return return
if not lic_files and d.getVar('SRC_URI', True): if not lic_files and d.getVar('SRC_URI', True):
package_qa_handle_error("license-checksum", pn + ": Recipe file fetches files and does not have license file information (LIC_FILES_CHKSUM)", d) sane = package_qa_handle_error("license-checksum", pn + ": Recipe file fetches files and does not have license file information (LIC_FILES_CHKSUM)", d)
return
srcdir = d.getVar('S', True) srcdir = d.getVar('S', True)
@@ -712,7 +711,7 @@ python populate_lic_qa_checksum() {
try: try:
(type, host, path, user, pswd, parm) = bb.fetch.decodeurl(url) (type, host, path, user, pswd, parm) = bb.fetch.decodeurl(url)
except bb.fetch.MalformedUrl: except bb.fetch.MalformedUrl:
package_qa_handle_error("license-checksum", pn + ": LIC_FILES_CHKSUM contains an invalid URL: " + url, d) sane = package_qa_handle_error("license-checksum", pn + ": LIC_FILES_CHKSUM contains an invalid URL: " + url, d)
continue continue
srclicfile = os.path.join(srcdir, path) srclicfile = os.path.join(srcdir, path)
if not os.path.isfile(srclicfile): if not os.path.isfile(srclicfile):
@@ -768,7 +767,10 @@ python populate_lic_qa_checksum() {
else: else:
msg = pn + ": LIC_FILES_CHKSUM is not specified for " + url msg = pn + ": LIC_FILES_CHKSUM is not specified for " + url
msg = msg + "\n" + pn + ": The md5 checksum is " + md5chksum msg = msg + "\n" + pn + ": The md5 checksum is " + md5chksum
package_qa_handle_error("license-checksum", msg, d) sane = package_qa_handle_error("license-checksum", msg, d)
if not sane:
bb.fatal("Fatal QA errors found, failing task.")
} }
def package_qa_check_staged(path,d): def package_qa_check_staged(path,d):