summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorRandy Witt <randy.e.witt@linux.intel.com>2015-03-02 10:55:37 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-03-10 10:47:44 +0000
commita39ce568e091a0305ea2806cdd041cda42680d65 (patch)
treeb160aa1bed2ffaba252932e537ea01eeea1fa381 /meta/classes
parent3f8ce1e755e4204c7bf03f937d063b70abd8c73c (diff)
downloadpoky-a39ce568e091a0305ea2806cdd041cda42680d65.tar.gz
base.bbclass: Add LIC_FILES_CHKSUM files to checksum files.
Previously, files with absolute paths in LIC_FILES_CHKSUM such as "file://${COMMON_LICENSE_DIR}/foo" would not result in a qa failure when the license file changed. To fix this problem, add any files with absolute paths from LIC_FILES_CHKSUM to the file-checksums varflag, so that changes in the license file are detected and cause the qa task for licenses to run. [Yocto #6450] (From OE-Core rev: 5df681259ae078c9d04d426fb5971eaa79d35ba5) Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/base.bbclass17
1 files changed, 17 insertions, 0 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 789af3b10b..2c2d0192f1 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -94,9 +94,26 @@ def extra_path_elements(d):
94 94
95PATH_prepend = "${@extra_path_elements(d)}" 95PATH_prepend = "${@extra_path_elements(d)}"
96 96
97def get_lic_checksum_file_list(d):
98 filelist = []
99 lic_files = d.getVar("LIC_FILES_CHKSUM", True) or ''
100
101 urls = lic_files.split()
102 for url in urls:
103 # We only care about items that are absolute paths since
104 # any others should be covered by SRC_URI.
105 try:
106 path = bb.fetch.decodeurl(url)[2]
107 if path[0] == '/':
108 filelist.append(path + ":" + str(os.path.exists(path)))
109 except bb.fetch.MalformedUrl:
110 raise bb.build.FuncFailed(d.getVar('PN', True) + ": LIC_FILES_CHKSUM contains an invalid URL: " + url)
111 return " ".join(filelist)
112
97addtask fetch 113addtask fetch
98do_fetch[dirs] = "${DL_DIR}" 114do_fetch[dirs] = "${DL_DIR}"
99do_fetch[file-checksums] = "${@bb.fetch.get_checksum_file_list(d)}" 115do_fetch[file-checksums] = "${@bb.fetch.get_checksum_file_list(d)}"
116do_fetch[file-checksums] += " ${@get_lic_checksum_file_list(d)}"
100do_fetch[vardeps] += "SRCREV" 117do_fetch[vardeps] += "SRCREV"
101python base_do_fetch() { 118python base_do_fetch() {
102 119