summaryrefslogtreecommitdiffstats
path: root/meta/classes/insane.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-15 12:55:30 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-19 17:24:46 +0000
commit1da8f52b67ac6ce5819e30530385e5628f11b85f (patch)
treebfda29162420863d98836d7552eabb595b3c0ab2 /meta/classes/insane.bbclass
parentdd286953208489f8c9c5d02de06dbd75709b01a5 (diff)
downloadpoky-1da8f52b67ac6ce5819e30530385e5628f11b85f.tar.gz
insane: Start to clean up do_configure_qa code
This cleans up the do_configure_qa code so that the exit status from package_qa_handle_error is handled correctly. It also converts package_qa_check_license to use our standard QA check configuration interface through package_qa_handle_error rather than a mix of return values, bb.fatal and bb.build.FuncFailed. Due to the merging of multiple lines into one message, we need to tweak a QA test to account for this. (From OE-Core rev: fbdf977a8094bb1e0baca85ffb3ed7f326986639) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/insane.bbclass')
-rw-r--r--meta/classes/insane.bbclass36
1 files changed, 21 insertions, 15 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index 70d5fb828d..f7781ce6fe 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -38,6 +38,7 @@ ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \
38 perms dep-cmp pkgvarcheck perm-config perm-line perm-link \ 38 perms dep-cmp pkgvarcheck perm-config perm-line perm-link \
39 split-strip packages-list pkgv-undefined var-undefined \ 39 split-strip packages-list pkgv-undefined var-undefined \
40 version-going-backwards expanded-d invalid-chars \ 40 version-going-backwards expanded-d invalid-chars \
41 license-checksum \
41 " 42 "
42FAKEROOT_QA = "host-user-contaminated" 43FAKEROOT_QA = "host-user-contaminated"
43FAKEROOT_QA[doc] = "QA tests which need to run under fakeroot. If any \ 44FAKEROOT_QA[doc] = "QA tests which need to run under fakeroot. If any \
@@ -631,6 +632,7 @@ def package_qa_check_symlink_to_sysroot(path, name, d, elf, messages):
631 if target.startswith(tmpdir): 632 if target.startswith(tmpdir):
632 trimmed = path.replace(os.path.join (d.getVar("PKGDEST", True), name), "") 633 trimmed = path.replace(os.path.join (d.getVar("PKGDEST", True), name), "")
633 messages["symlink-to-sysroot"] = "Symlink %s in %s points to TMPDIR" % (trimmed, name) 634 messages["symlink-to-sysroot"] = "Symlink %s in %s points to TMPDIR" % (trimmed, name)
635
634def package_qa_check_license(workdir, d): 636def package_qa_check_license(workdir, d):
635 """ 637 """
636 Check for changes in the license files 638 Check for changes in the license files
@@ -643,11 +645,11 @@ def package_qa_check_license(workdir, d):
643 pn = d.getVar('PN', True) 645 pn = d.getVar('PN', True)
644 646
645 if lic == "CLOSED": 647 if lic == "CLOSED":
646 return True 648 return
647 649
648 if not lic_files: 650 if not lic_files:
649 bb.error(pn + ": Recipe file does not have license file information (LIC_FILES_CHKSUM)") 651 package_qa_handle_error("license-checksum", pn + ": Recipe file does not have license file information (LIC_FILES_CHKSUM)", d)
650 return False 652 return
651 653
652 srcdir = d.getVar('S', True) 654 srcdir = d.getVar('S', True)
653 655
@@ -655,10 +657,12 @@ def package_qa_check_license(workdir, d):
655 try: 657 try:
656 (type, host, path, user, pswd, parm) = bb.fetch.decodeurl(url) 658 (type, host, path, user, pswd, parm) = bb.fetch.decodeurl(url)
657 except bb.fetch.MalformedUrl: 659 except bb.fetch.MalformedUrl:
658 raise bb.build.FuncFailed( pn + ": LIC_FILES_CHKSUM contains an invalid URL: " + url) 660 package_qa_handle_error("license-checksum", pn + ": LIC_FILES_CHKSUM contains an invalid URL: " + url, d)
661 continue
659 srclicfile = os.path.join(srcdir, path) 662 srclicfile = os.path.join(srcdir, path)
660 if not os.path.isfile(srclicfile): 663 if not os.path.isfile(srclicfile):
661 raise bb.build.FuncFailed( pn + ": LIC_FILES_CHKSUM points to an invalid file: " + srclicfile) 664 package_qa_handle_error("license-checksum", pn + ": LIC_FILES_CHKSUM points to an invalid file: " + srclicfile, d)
665 continue
662 666
663 recipemd5 = parm.get('md5', '') 667 recipemd5 = parm.get('md5', '')
664 beginline, endline = 0, 0 668 beginline, endline = 0, 0
@@ -693,8 +697,8 @@ def package_qa_check_license(workdir, d):
693 bb.note (pn + ": md5 checksum matched for ", url) 697 bb.note (pn + ": md5 checksum matched for ", url)
694 else: 698 else:
695 if recipemd5: 699 if recipemd5:
696 bb.error(pn + ": md5 data is not matching for ", url) 700 msg = pn + ": The LIC_FILES_CHKSUM does not match for " + url
697 bb.error(pn + ": The new md5 checksum is ", md5chksum) 701 msg = msg + "\n" + pn + ": The new md5 checksum is " + md5chksum
698 if beginline: 702 if beginline:
699 if endline: 703 if endline:
700 srcfiledesc = "%s (lines %d through to %d)" % (srclicfile, beginline, endline) 704 srcfiledesc = "%s (lines %d through to %d)" % (srclicfile, beginline, endline)
@@ -704,13 +708,12 @@ def package_qa_check_license(workdir, d):
704 srcfiledesc = "%s (ending on line %d)" % (srclicfile, endline) 708 srcfiledesc = "%s (ending on line %d)" % (srclicfile, endline)
705 else: 709 else:
706 srcfiledesc = srclicfile 710 srcfiledesc = srclicfile
707 bb.error(pn + ": Check if the license information has changed in %s to verify that the LICENSE value \"%s\" remains valid" % (srcfiledesc, lic)) 711 msg = msg + "\n" + pn + ": Check if the license information has changed in %s to verify that the LICENSE value \"%s\" remains valid" % (srcfiledesc, lic)
708 else:
709 bb.error(pn + ": md5 checksum is not specified for ", url)
710 bb.error(pn + ": The md5 checksum is ", md5chksum)
711 sane = False
712 712
713 return sane 713 else:
714 msg = pn + ": LIC_FILES_CHKSUM is not specified for " + url
715 msg = msg + "\n" + pn + ": The md5 checksum is " + md5chksum
716 package_qa_handle_error("license-checksum", msg, d)
714 717
715def package_qa_check_staged(path,d): 718def package_qa_check_staged(path,d):
716 """ 719 """
@@ -1160,8 +1163,7 @@ Missing inherit gettext?""" % (gt, config))
1160 # Check license variables 1163 # Check license variables
1161 ########################################################################### 1164 ###########################################################################
1162 1165
1163 if not package_qa_check_license(workdir, d): 1166 package_qa_check_license(workdir, d)
1164 bb.fatal("Licensing Error: LIC_FILES_CHKSUM does not match, please fix")
1165 1167
1166 ########################################################################### 1168 ###########################################################################
1167 # Check unrecognised configure options (with a white list) 1169 # Check unrecognised configure options (with a white list)
@@ -1193,6 +1195,10 @@ Missing inherit gettext?""" % (gt, config))
1193 pn = d.getVar('PN', True) 1195 pn = d.getVar('PN', True)
1194 error_msg = "%s: invalid PACKAGECONFIG: %s" % (pn, pconfig) 1196 error_msg = "%s: invalid PACKAGECONFIG: %s" % (pn, pconfig)
1195 package_qa_handle_error("invalid-packageconfig", error_msg, d) 1197 package_qa_handle_error("invalid-packageconfig", error_msg, d)
1198
1199 qa_sane = d.getVar("QA_SANE", True)
1200 if not qa_sane:
1201 bb.fatal("Fatal QA errors found, failing task.")
1196} 1202}
1197 1203
1198python do_qa_unpack() { 1204python do_qa_unpack() {