Patchwork [CONSOLIDATED,PULL,3/9] multilib.bbclass: Added multilib specific package QA.

login
register
mail settings
Submitter Saul Wold
Date May 18, 2012, 2:18 p.m.
Message ID <85c5eba684762030ce443c521f07905cd8f5aa5f.1337350637.git.sgw@linux.intel.com>
Download mbox | patch
Permalink /patch/27975/
State New
Headers show

Comments

Saul Wold - May 18, 2012, 2:18 p.m.
From: Lianhao Lu <lianhao.lu@intel.com>

Added a new PACKAGEFUNCS function to check the multilib packages'
dependency.

Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
---
 meta/classes/multilib.bbclass |   31 +++++++++++++++++++++++++++++++
 1 files changed, 31 insertions(+), 0 deletions(-)

Patch

diff --git a/meta/classes/multilib.bbclass b/meta/classes/multilib.bbclass
index c2d2f85..f3e7618 100644
--- a/meta/classes/multilib.bbclass
+++ b/meta/classes/multilib.bbclass
@@ -66,3 +66,34 @@  python __anonymous () {
     clsextend.map_variable("PACKAGE_INSTALL")
     clsextend.map_variable("INITSCRIPT_PACKAGES")
 }
+
+PACKAGEFUNCS_append = "do_package_qa_multilib"
+
+python do_package_qa_multilib() {
+
+    def check_mlprefix(pkg, var, mlprefix):
+        values = bb.utils.explode_dep_versions(d.getVar('%s_%s' % (var, pkg), True) or d.getVar(var, True) or "")
+        candidates = []
+        for i in values.keys():
+            if i.startswith('virtual/'):
+                i = i[len('virtual/'):]
+            if (not i.startswith('kernel-module')) and (not i.startswith(mlprefix)):
+                candidates.append(i)
+        if len(candidates) > 0:
+            bb.warn("Multilib QA Issue: %s package %s - suspicious values '%s' in %s" 
+                   % (d.getVar('PN', True), pkg, ' '.join(candidates), var))
+
+    ml = d.getVar('MLPREFIX', True)
+    if not ml:
+        return
+
+    packages = d.getVar('PACKAGES', True)
+    for pkg in packages.split():
+        check_mlprefix(pkg, 'RDEPENDS', ml)
+        check_mlprefix(pkg, 'RPROVIDES', ml)
+        check_mlprefix(pkg, 'RRECOMMENDS', ml)
+        check_mlprefix(pkg, 'RSUGGESTS', ml)
+        check_mlprefix(pkg, 'RREPLACES', ml)
+        check_mlprefix(pkg, 'RCONFLICTS', ml)
+}
+