diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2010-05-14 04:12:35 +0800 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-05-14 04:12:35 +0800 |
commit | dfd1472edaa7e7569fc5219510d94a550df44af8 (patch) | |
tree | 5bbb06d33f6c782746f5a32ab6c77bd63e22bacc /meta | |
parent | 505c26951b14898cb9ede7c4cb76217202b655c4 (diff) | |
parent | 8825d4d455412bbed6f58e81b81d14a5399840b4 (diff) | |
download | poky-dfd1472edaa7e7569fc5219510d94a550df44af8.tar.gz |
Merge branch 'nitin/lic1' of ssh://git.pokylinux.org/poky-contrib
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/insane.bbclass | 65 | ||||
-rw-r--r-- | meta/packages/zlib/zlib_1.2.3.bb | 2 |
2 files changed, 66 insertions, 1 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass index 6d82e4df88..0c9bde349c 100644 --- a/meta/classes/insane.bbclass +++ b/meta/classes/insane.bbclass | |||
@@ -266,6 +266,68 @@ def package_qa_check_buildpaths(path, name, d): | |||
266 | sane = package_qa_handle_error(9, error_msg, name, path, d) | 266 | sane = package_qa_handle_error(9, error_msg, name, path, d) |
267 | return sane | 267 | return sane |
268 | 268 | ||
269 | def package_qa_check_license(workdir, d): | ||
270 | """ | ||
271 | Check for changes in the license files | ||
272 | """ | ||
273 | import tempfile | ||
274 | sane = True | ||
275 | |||
276 | lic_files = bb.data.getVar('LIC_FILES_CHKSUM', d, True) | ||
277 | |||
278 | if not lic_files: | ||
279 | # just throw a warning now. Once licensing data in entered for enough of the recipes, | ||
280 | # this will be converted into error and False will be returned. | ||
281 | bb.warn(" Recipe (.bb) file does not have license file information (LIC_FILES_CHKSUM)") | ||
282 | return True | ||
283 | |||
284 | srcdir = bb.data.getVar('S', d, True) | ||
285 | |||
286 | for url in lic_files.split(): | ||
287 | (type, host, path, user, pswd, parm) = bb.decodeurl(url) | ||
288 | srclicfile = os.path.join(srcdir, path) | ||
289 | |||
290 | if 'md5' not in parm: | ||
291 | bb.error("md5 checksum is not specified for ", url) | ||
292 | return False | ||
293 | beginline, endline = 0, 0 | ||
294 | if 'beginline' in parm: | ||
295 | beginline = int(parm['beginline']) | ||
296 | if 'endline' in parm: | ||
297 | endline = int(parm['endline']) | ||
298 | |||
299 | if (not beginline) and (not endline): | ||
300 | md5chksum = bb.utils.md5_file(srclicfile) | ||
301 | else: | ||
302 | fi = open(srclicfile, 'r') | ||
303 | fo = tempfile.NamedTemporaryFile(mode='wb', prefix='poky.', suffix='.tmp', delete=False) | ||
304 | tmplicfile = fo.name; | ||
305 | lineno = 0 | ||
306 | linesout = 0 | ||
307 | for line in fi: | ||
308 | lineno += 1 | ||
309 | if (lineno >= beginline): | ||
310 | if ((lineno <= endline) or not endline): | ||
311 | fo.write(line) | ||
312 | linesout += 1 | ||
313 | else: | ||
314 | break | ||
315 | fo.flush() | ||
316 | fo.close() | ||
317 | fi.close() | ||
318 | md5chksum = bb.utils.md5_file(tmplicfile) | ||
319 | os.unlink(tmplicfile) | ||
320 | |||
321 | if parm['md5'] == md5chksum: | ||
322 | bb.note ("md5 checksum matched for ", url) | ||
323 | else: | ||
324 | bb.error ("md5 data is not matching for ", url) | ||
325 | bb.note ("The new md5 checksum is ", md5chksum) | ||
326 | bb.note ("Check if the license information has changed, and if it has update the .bb file with correct license") | ||
327 | return False | ||
328 | |||
329 | return sane | ||
330 | |||
269 | def package_qa_check_staged(path,d): | 331 | def package_qa_check_staged(path,d): |
270 | """ | 332 | """ |
271 | Check staged la and pc files for sanity | 333 | Check staged la and pc files for sanity |
@@ -385,7 +447,8 @@ python do_package_qa () { | |||
385 | if not package_qa_check_rdepends(package, workdir, d): | 447 | if not package_qa_check_rdepends(package, workdir, d): |
386 | rdepends_sane = False | 448 | rdepends_sane = False |
387 | 449 | ||
388 | if not walk_sane or not rdepends_sane: | 450 | |
451 | if not walk_sane or not rdepends_sane or not package_qa_check_license(workdir, d): | ||
389 | bb.fatal("QA run found fatal errors. Please consider fixing them.") | 452 | bb.fatal("QA run found fatal errors. Please consider fixing them.") |
390 | bb.note("DONE with PACKAGE QA") | 453 | bb.note("DONE with PACKAGE QA") |
391 | } | 454 | } |
diff --git a/meta/packages/zlib/zlib_1.2.3.bb b/meta/packages/zlib/zlib_1.2.3.bb index 97d0be5d5e..c58d5f2d25 100644 --- a/meta/packages/zlib/zlib_1.2.3.bb +++ b/meta/packages/zlib/zlib_1.2.3.bb | |||
@@ -3,6 +3,8 @@ SECTION = "libs" | |||
3 | PRIORITY = "required" | 3 | PRIORITY = "required" |
4 | HOMEPAGE = "http://www.gzip.org/zlib/" | 4 | HOMEPAGE = "http://www.gzip.org/zlib/" |
5 | LICENSE = "zlib" | 5 | LICENSE = "zlib" |
6 | LIC_FILES_CHKSUM = "file://README;md5=ae764cfda68da96df20af9fbf9fe49bd \ | ||
7 | file://zlib.h;beginline=1;endline=30;md5=6ab03f03a5ee92d06b809797d4d5586d " | ||
6 | PR = "r7" | 8 | PR = "r7" |
7 | 9 | ||
8 | SRC_URI = "http://www.zlib.net/zlib-1.2.3.tar.bz2 \ | 10 | SRC_URI = "http://www.zlib.net/zlib-1.2.3.tar.bz2 \ |