From 70be4ca7dbf5049c4a5450f7eebbd0c57a548702 Mon Sep 17 00:00:00 2001 From: Sergei Miroshnichenko Date: Tue, 18 Oct 2016 13:06:57 +0300 Subject: [PATCH] license: Don't validate checksums for COMMON_LICENSE_DIR If LIC_FILES_CHKSUM points to the generic license file through COMMON_LICENSE_DIR (or, equivalently, ${COREBASE}/meta/files/common-licenses/) instead of embedding it into the package, there should be no checksums validation. Signed-off-by: Sergei Miroshnichenko --- meta/classes/insane.bbclass | 4 ++++ meta/classes/license.bbclass | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass index 1d73778255a..6868cc77f8c 100644 --- a/meta/classes/insane.bbclass +++ b/meta/classes/insane.bbclass @@ -714,6 +714,7 @@ python populate_lic_qa_checksum() { sane = package_qa_handle_error("license-checksum", pn + ": Recipe file fetches files and does not have license file information (LIC_FILES_CHKSUM)", d) srcdir = d.getVar('S', True) + generic_directory = d.getVar('COMMON_LICENSE_DIR', True) for url in lic_files.split(): try: @@ -727,6 +728,9 @@ python populate_lic_qa_checksum() { continue recipemd5 = parm.get('md5', '') + if os.path.dirname(path) == generic_directory: + continue + beginline, endline = 0, 0 if 'beginline' in parm: beginline = int(parm['beginline']) diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass index da4fc3e1d4c..2de3113557f 100644 --- a/meta/classes/license.bbclass +++ b/meta/classes/license.bbclass @@ -478,6 +478,10 @@ def find_license_files(d): (type, host, path, user, pswd, parm) = bb.fetch.decodeurl(url) except bb.fetch.MalformedUrl: bb.fatal("%s: LIC_FILES_CHKSUM contains an invalid URL: %s" % (d.getVar('PF', True), url)) + + if os.path.dirname(path) == generic_directory: + lic_chksums[path] = 'none' + continue; # We want the license filename and path chksum = parm['md5'] if 'md5' in parm else parm['sha256'] lic_chksums[path] = chksum -- 2.47.2