diff options
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/insane.bbclass | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass index b26216e8b4..53942365ab 100644 --- a/meta/classes/insane.bbclass +++ b/meta/classes/insane.bbclass @@ -29,7 +29,7 @@ QA_SANE = "True" WARN_QA ?= "ldflags useless-rpaths rpaths staticdev libdir xorg-driver-abi \ textrel already-stripped incompatible-license files-invalid \ installed-vs-shipped compile-host-path install-host-path \ - pn-overrides infodir \ + pn-overrides infodir build-deps \ " ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \ perms dep-cmp pkgvarcheck perm-config perm-line perm-link \ @@ -755,7 +755,7 @@ def package_qa_walk(path, warnfuncs, errorfuncs, skip, package, d): return len(errors) == 0 -def package_qa_check_rdepends(pkg, pkgdest, skip, d): +def package_qa_check_rdepends(pkg, pkgdest, skip, taskdeps, packages, d): # Don't do this check for kernel/module recipes, there aren't too many debug/development # packages and you can get false positives e.g. on kernel-module-lirc-dev if bb.data.inherits_class("kernel", d) or bb.data.inherits_class("module-base", d): @@ -778,6 +778,24 @@ def package_qa_check_rdepends(pkg, pkgdest, skip, d): if (not "-dev" in pkg and not "-staticdev" in pkg) and rdepend.endswith("-dev") and "dev-deps" not in skip: error_msg = "%s rdepends on %s" % (pkg, rdepend) sane = package_qa_handle_error("dev-deps", error_msg, d) + if rdepend not in packages: + rdep_data = oe.packagedata.read_subpkgdata(rdepend, d) + if rdep_data and 'PN' in rdep_data and rdep_data['PN'] in taskdeps: + continue + if not rdep_data or not 'PN' in rdep_data: + pkgdata_dir = d.getVar("PKGDATA_DIR", True) + try: + possibles = os.listdir("%s/runtime-rprovides/%s/" % (pkgdata_dir, rdepend)) + except OSError: + possibles = [] + for p in possibles: + rdep_data = oe.packagedata.read_subpkgdata(p, d) + if rdep_data and 'PN' in rdep_data and rdep_data['PN'] in taskdeps: + break + if rdep_data and 'PN' in rdep_data and rdep_data['PN'] in taskdeps: + continue + error_msg = "%s rdepends on %s but its not a build dependency?" % (pkg, rdepend) + sane = package_qa_handle_error("build-deps", error_msg, d) return sane @@ -820,6 +838,7 @@ def package_qa_check_deps(pkg, pkgdest, skip, d): # The PACKAGE FUNC to scan each package python do_package_qa () { import subprocess + import oe.packagedata bb.note("DO PACKAGE QA") @@ -870,6 +889,11 @@ python do_package_qa () { # The package name matches the [a-z0-9.+-]+ regular expression pkgname_pattern = re.compile("^[a-z0-9.+-]+$") + taskdepdata = d.getVar("BB_TASKDEPDATA", False) + taskdeps = set() + for dep in taskdepdata: + taskdeps.add(taskdepdata[dep][0]) + g = globals() walk_sane = True rdepends_sane = True @@ -900,7 +924,7 @@ python do_package_qa () { path = "%s/%s" % (pkgdest, package) if not package_qa_walk(path, warnchecks, errorchecks, skip, package, d): walk_sane = False - if not package_qa_check_rdepends(package, pkgdest, skip, d): + if not package_qa_check_rdepends(package, pkgdest, skip, taskdeps, packages, d): rdepends_sane = False if not package_qa_check_deps(package, pkgdest, skip, d): deps_sane = False @@ -915,6 +939,7 @@ python do_package_qa () { bb.note("DONE with PACKAGE QA") } +do_package_qa[rdeptask] = "do_packagedata" addtask do_package_qa after do_packagedata do_package before do_build SSTATETASKS += "do_package_qa" @@ -1038,6 +1063,8 @@ python () { for var in 'RDEPENDS', 'RRECOMMENDS', 'RSUGGESTS', 'RCONFLICTS', 'RPROVIDES', 'RREPLACES', 'FILES', 'pkg_preinst', 'pkg_postinst', 'pkg_prerm', 'pkg_postrm', 'ALLOW_EMPTY': if d.getVar(var): issues.append(var) + else: + d.setVarFlag('do_package_qa', 'rdeptask', '') for i in issues: package_qa_handle_error("pkgvarcheck", "%s: Variable %s is set as not being package specific, please fix this." % (d.getVar("FILE", True), i), d) } |