summaryrefslogtreecommitdiffstats
path: root/meta/classes/license_image.bbclass
diff options
context:
space:
mode:
authorMike Crowe <mac@mcrowe.com>2021-10-15 15:39:54 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-10-17 11:56:33 +0100
commitcdeb02654fbaa47677b5c68521d05a5a575ac90d (patch)
treea8951fd93b91b0a3c64336a79bd74c68fba7c8d3 /meta/classes/license_image.bbclass
parent51b1611e204b32b3e65176ef86d4562e2f330835 (diff)
downloadpoky-cdeb02654fbaa47677b5c68521d05a5a575ac90d.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. (From OE-Core rev: bb164adca94b5a43751aabe6b6d702a3d60dfdc7) 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.bbclass11
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):
75 pkg_dic[pkg]["LICENSES"] = re.sub(r' *', ' ', pkg_dic[pkg]["LICENSES"]) 75 pkg_dic[pkg]["LICENSES"] = re.sub(r' *', ' ', pkg_dic[pkg]["LICENSES"])
76 pkg_dic[pkg]["LICENSES"] = pkg_dic[pkg]["LICENSES"].split() 76 pkg_dic[pkg]["LICENSES"] = pkg_dic[pkg]["LICENSES"].split()
77 if pkg in whitelist: 77 if pkg in whitelist:
78 bb.warn("Including %s with an incompatible license %s into the image, because it has been whitelisted." %(pkg, pkg_dic[pkg]["LICENSE"])) 78 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)
79 79
80 if not "IMAGE_MANIFEST" in pkg_dic[pkg]: 80 if not "IMAGE_MANIFEST" in pkg_dic[pkg]:
81 # Rootfs manifest 81 # Rootfs manifest
@@ -105,10 +105,10 @@ def write_license_files(d, license_manifest, pkg_dic, rootfs=True):
105 continue 105 continue
106 106
107 if not os.path.exists(lic_file): 107 if not os.path.exists(lic_file):
108 bb.warn("The license listed %s was not in the "\ 108 oe.qa.handle_error('license-file-missing',
109 "licenses collected for recipe %s" 109 "The license listed %s was not in the "\
110 % (lic, pkg_dic[pkg]["PN"])) 110 "licenses collected for recipe %s"
111 111 % (lic, pkg_dic[pkg]["PN"]), d)
112 # Two options here: 112 # Two options here:
113 # - Just copy the manifest 113 # - Just copy the manifest
114 # - Copy the manifest and the license directories 114 # - Copy the manifest and the license directories
@@ -274,6 +274,7 @@ do_rootfs[recrdeptask] += "do_populate_lic"
274 274
275python do_populate_lic_deploy() { 275python do_populate_lic_deploy() {
276 license_deployed_manifest(d) 276 license_deployed_manifest(d)
277 oe.qa.exit_if_errors(d)
277} 278}
278 279
279addtask populate_lic_deploy before do_build after do_image_complete 280addtask populate_lic_deploy before do_build after do_image_complete