[kirkstone,19/19] license_image.bbclass: Make QA errors fail the build

Message ID 72aa42425e456ab0210129df01d829465acadb6d.1653488418.git.steve@sakoman.com
State Accepted, archived
Commit 72aa42425e456ab0210129df01d829465acadb6d
Headers show
Series [kirkstone,01/19] pcre2: CVE-2022-1586 Out-of-bounds read | expand

Commit Message

Steve Sakoman May 25, 2022, 2:29 p.m. UTC
From: Peter Kjellerstedt <peter.kjellerstedt@axis.com>

If, e.g., license-file-missing is added to ERROR_QA, then the build
should fail if any licenses are missing.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit dd91c4bec8335cab2bbd0b33caf50d314ca72bdc)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
---
 meta/classes/license_image.bbclass | 2 ++
 1 file changed, 2 insertions(+)

Patch

diff --git a/meta/classes/license_image.bbclass b/meta/classes/license_image.bbclass
index 7e1d0e08a9..3213ea758e 100644
--- a/meta/classes/license_image.bbclass
+++ b/meta/classes/license_image.bbclass
@@ -104,6 +104,8 @@  def write_license_files(d, license_manifest, pkg_dic, rootfs=True):
                                        "The license listed %s was not in the "\
                                        "licenses collected for recipe %s"
                                        % (lic, pkg_dic[pkg]["PN"]), d)
+    oe.qa.exit_if_errors(d)
+
     # Two options here:
     # - Just copy the manifest
     # - Copy the manifest and the license directories