diff options
Diffstat (limited to 'meta')
| -rw-r--r-- | meta/classes/insane.bbclass | 63 | ||||
| -rw-r--r-- | meta/packages/zlib/zlib_1.2.3.bb | 2 |
2 files changed, 64 insertions, 1 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass index 6d82e4df88..88e77a75ee 100644 --- a/meta/classes/insane.bbclass +++ b/meta/classes/insane.bbclass | |||
| @@ -266,6 +266,66 @@ 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 | bb.error(" Recipe (.bb) file does not have license file information (LIC_FILES_CHKSUM)") | ||
| 280 | return False | ||
| 281 | |||
| 282 | srcdir = bb.data.getVar('S', d, True) | ||
| 283 | |||
| 284 | for url in lic_files.split(): | ||
| 285 | (type, host, path, user, pswd, parm) = bb.decodeurl(url) | ||
| 286 | srclicfile = os.path.join(srcdir, path) | ||
| 287 | |||
| 288 | if 'md5' not in parm: | ||
| 289 | bb.error("md5 checksum is not specified for ", url) | ||
| 290 | return False | ||
| 291 | beginline, endline = 0, 0 | ||
| 292 | if 'beginline' in parm: | ||
| 293 | beginline = int(parm['beginline']) | ||
| 294 | if 'endline' in parm: | ||
| 295 | endline = int(parm['endline']) | ||
| 296 | |||
| 297 | if (not beginline) and (not endline): | ||
| 298 | md5chksum = bb.utils.md5_file(srclicfile) | ||
| 299 | else: | ||
| 300 | fi = open(srclicfile, 'r') | ||
| 301 | fo = tempfile.NamedTemporaryFile(mode='wb', prefix='poky.', suffix='.tmp', delete=False) | ||
| 302 | tmplicfile = fo.name; | ||
| 303 | lineno = 0 | ||
| 304 | linesout = 0 | ||
| 305 | for line in fi: | ||
| 306 | lineno += 1 | ||
| 307 | if (lineno >= beginline): | ||
| 308 | if ((lineno <= endline) or not endline): | ||
| 309 | fo.write(line) | ||
| 310 | linesout += 1 | ||
| 311 | else: | ||
| 312 | break | ||
| 313 | fo.flush() | ||
| 314 | fo.close() | ||
| 315 | fi.close() | ||
| 316 | md5chksum = bb.utils.md5_file(tmplicfile) | ||
| 317 | os.unlink(tmplicfile) | ||
| 318 | |||
| 319 | if parm['md5'] == md5chksum: | ||
| 320 | bb.note ("md5 checksum matched for ", url) | ||
| 321 | else: | ||
| 322 | bb.error ("md5 data is not matching for ", url) | ||
| 323 | bb.note ("The new md5 checksum is ", md5chksum) | ||
| 324 | bb.note ("Check if the license information has changed, and if it has update the .bb file with correct license") | ||
| 325 | return False | ||
| 326 | |||
| 327 | return sane | ||
| 328 | |||
| 269 | def package_qa_check_staged(path,d): | 329 | def package_qa_check_staged(path,d): |
| 270 | """ | 330 | """ |
| 271 | Check staged la and pc files for sanity | 331 | Check staged la and pc files for sanity |
| @@ -385,7 +445,8 @@ python do_package_qa () { | |||
| 385 | if not package_qa_check_rdepends(package, workdir, d): | 445 | if not package_qa_check_rdepends(package, workdir, d): |
| 386 | rdepends_sane = False | 446 | rdepends_sane = False |
| 387 | 447 | ||
| 388 | if not walk_sane or not rdepends_sane: | 448 | |
| 449 | 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.") | 450 | bb.fatal("QA run found fatal errors. Please consider fixing them.") |
| 390 | bb.note("DONE with PACKAGE QA") | 451 | bb.note("DONE with PACKAGE QA") |
| 391 | } | 452 | } |
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 \ |
