From patchwork Fri Sep 14 08:53:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: insane.bbclass: add library dir sanity check Date: Fri, 14 Sep 2012 08:53:59 -0000 From: Radu Moisan X-Patchwork-Id: 36523 Message-Id: <1347612839-16068-1-git-send-email-radu.moisan@intel.com> To: openembedded-core@lists.openembedded.org Check in ${PKGD} for libraries in other locations then ${libdir}. Trigger a warning if so. [Yocto #2038] Signed-off-by: Radu Moisan --- meta/classes/insane.bbclass | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass index e74eb3f..3a1b469 100644 --- a/meta/classes/insane.bbclass +++ b/meta/classes/insane.bbclass @@ -212,6 +212,17 @@ def package_qa_check_staticdev(path, name, d, elf, messages): messages.append("non -staticdev package contains static .a library: %s path '%s'" % \ (name, package_qa_clean_path(path,d))) +def package_qa_check_libdir(path,libdir): + """ + """ + import re + lib_re = re.compile("^.*\.(so|a)") + for root, dirs, files in os.walk(path): + if libdir not in root: + for file in files: + if lib_re.match(file): + bb.warn("Found library in wrong location: %s" % os.path.join(root,file)) + QAPATHTEST[debug-files] = "package_qa_check_dbg" def package_qa_check_dbg(path, name, d, elf, messages): """ @@ -688,6 +699,12 @@ python do_package_qa () { rdepends_sane = False + ml = d.getVar("MLPREFIX", True) or "" + if ml: + pkgd = d.getVar('PKGD', True) + libdir = d.getVar("libdir", True) + package_qa_check_libdir(pkgd,libdir) + if not walk_sane or not rdepends_sane: bb.fatal("QA run found fatal errors. Please consider fixing them.") bb.note("DONE with PACKAGE QA")