diff options
author | Mike Crowe <mac@mcrowe.com> | 2021-10-15 15:39:54 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-10-17 11:55:21 +0100 |
commit | bb164adca94b5a43751aabe6b6d702a3d60dfdc7 (patch) | |
tree | ffcb0e7e85dd7959ea8e192102f6ede0983034fe /meta/classes/license_image.bbclass | |
parent | f0ad152ef4cc15c042bc9eeefb6af096d054b220 (diff) | |
download | openembedded-core-contrib-bb164adca94b5a43751aabe6b6d702a3d60dfdc7.tar.gz |
insane,license,license_image: Allow treating license problems as errors
Use the same WARN_WA and ERROR_QA variables as insane.bbclass to allow
individual recipes, the distro or other configuration to determine
whether the various detected license errors should be treated as a
warning (as now) or as an error.
oe.qa.handle_error isn't immediately fatal, so oe.qa.exit_if_errors must
be called at the end of do_populate_lic to fail the task.
Signed-off-by: Mike Crowe <mac@mcrowe.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/license_image.bbclass')
-rw-r--r-- | meta/classes/license_image.bbclass | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/meta/classes/license_image.bbclass b/meta/classes/license_image.bbclass index 5490d121f1..bf70bee99b 100644 --- a/meta/classes/license_image.bbclass +++ b/meta/classes/license_image.bbclass @@ -75,7 +75,7 @@ def write_license_files(d, license_manifest, pkg_dic, rootfs=True): pkg_dic[pkg]["LICENSES"] = re.sub(r' *', ' ', pkg_dic[pkg]["LICENSES"]) pkg_dic[pkg]["LICENSES"] = pkg_dic[pkg]["LICENSES"].split() if pkg in whitelist: - bb.warn("Including %s with an incompatible license %s into the image, because it has been whitelisted." %(pkg, pkg_dic[pkg]["LICENSE"])) + oe.qa.handle_error('license-incompatible', "Including %s with an incompatible license %s into the image, because it has been whitelisted." %(pkg, pkg_dic[pkg]["LICENSE"]), d) if not "IMAGE_MANIFEST" in pkg_dic[pkg]: # Rootfs manifest @@ -105,10 +105,10 @@ def write_license_files(d, license_manifest, pkg_dic, rootfs=True): continue if not os.path.exists(lic_file): - bb.warn("The license listed %s was not in the "\ - "licenses collected for recipe %s" - % (lic, pkg_dic[pkg]["PN"])) - + oe.qa.handle_error('license-file-missing', + "The license listed %s was not in the "\ + "licenses collected for recipe %s" + % (lic, pkg_dic[pkg]["PN"]), d) # Two options here: # - Just copy the manifest # - Copy the manifest and the license directories @@ -274,6 +274,7 @@ do_rootfs[recrdeptask] += "do_populate_lic" python do_populate_lic_deploy() { license_deployed_manifest(d) + oe.qa.exit_if_errors(d) } addtask populate_lic_deploy before do_build after do_image_complete |