Patchwork [7/7] multilib_global.bbclass: Fix non-multilib package provides

login
register
mail settings
Submitter Mark Hatle
Date Sept. 20, 2011, 9:33 p.m.
Message ID <f800392c540a0e9ea9131c219bced20f9145a2b9.1316553828.git.mark.hatle@windriver.com>
Download mbox | patch
Permalink /patch/11761/
State New, archived
Headers show

Comments

Mark Hatle - Sept. 20, 2011, 9:33 p.m.
In non-multilib packages, configured in a multilib configuration we
need to adjust the system provides and rprovides to include the
virtual multilib variant.

This resolves a problem introduced in the
329d864f9bbf94ad3aae8df43d63fe10e4237e4f commit.  Where "allarch"
packages were suddenly providing all variants of an object.

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
 meta/classes/multilib_global.bbclass |   30 +++++++++++++++++++++++++-----
 1 files changed, 25 insertions(+), 5 deletions(-)

Patch

diff --git a/meta/classes/multilib_global.bbclass b/meta/classes/multilib_global.bbclass
index ed14565..c9bbe8f 100644
--- a/meta/classes/multilib_global.bbclass
+++ b/meta/classes/multilib_global.bbclass
@@ -6,16 +6,36 @@  python multilib_virtclass_handler_global () {
 
     if isinstance(e, bb.event.RecipeParsed) and not variant:
         if bb.data.inherits_class('kernel', e.data) or bb.data.inherits_class('module-base', e.data) or bb.data.inherits_class('allarch', e.data):
-            origprovs = provs = e.data.getVar("PROVIDES", True)
-            rprovs = e.data.getVar("RPROVIDES", True)
             variants = (e.data.getVar("MULTILIB_VARIANTS", True) or "").split()
+
+            # Process PROVIDES
+            origprovs = provs = e.data.getVar("PROVIDES", True) or ""
             for variant in variants:
                 provs = provs + " " + multilib_map_variable("PROVIDES", variant, e.data)
-                for pkg in e.data.getVar("PACKAGES", True).split():
-                    rprovs = rprovs + " " + variant + "-" + pkg
+                # Reset to original value so next time around multilib_map_variable works properly
                 e.data.setVar("PROVIDES", origprovs)
+            bb.warn("PROVIDES: %s" % (provs))
             e.data.setVar("PROVIDES", provs)
+
+            # Process RPROVIDES
+            origrprovs = rprovs = e.data.getVar("RPROVIDES", True) or ""
+            for variant in variants:
+                rprovs = rprovs + " " + multilib_map_variable("RPROVIDES", variant, e.data)
+                # Reset to original value so next time around multilib_map_variable works properly
+                e.data.setVar("RPROVIDES", origrprovs)
+            bb.warn("RPROVIDES: %s" % (rprovs))
             e.data.setVar("RPROVIDES", rprovs)
+
+	    # Process RPROVIDES_${PN}...
+            for pkg in (e.data.getVar("PACKAGES", True) or "").split():
+                origrprovs = rprovs = e.data.getVar("RPROVIDES_%s" % pkg, True) or ""
+                for variant in variants:
+                    rprovs = rprovs + " " + multilib_map_variable("RPROVIDES_%s" % pkg, variant, e.data)
+                    rprovs = rprovs + " " + variant + "-" + pkg
+                    # Reset to original value so next time around multilib_map_variable works properly
+                    e.data.setVar("RPROVIDES_%s" % pkg, origrprovs)
+                bb.warn("RPROVIDES_%s: %s" % (pkg, rprovs))
+                e.data.setVar("RPROVIDES_%s" % pkg, rprovs)
 }
 
 addhandler multilib_virtclass_handler_global
@@ -35,7 +55,7 @@  def multilib_extend_name(variant, name):
 def multilib_map_variable(varname, variant, d):
     var = d.getVar(varname, True)
     if not var:
-        return
+        return ""
     var = var.split()
     newvar = []
     for v in var: