Patchwork [V2,1/7] multilib.bbclass: Added multilib specific package QA.

login
register
mail settings
Submitter Lianhao Lu
Date April 27, 2012, 6:34 a.m.
Message ID <f640dfb6acb1d703fefae61226547773f82a2a07.1335508325.git.lianhao.lu@intel.com>
Download mbox | patch
Permalink /patch/26509/
State New
Headers show

Comments

Lianhao Lu - April 27, 2012, 6:34 a.m.
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..58cd113 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(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)
+}
+