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

login
register
mail settings
Submitter Mark Hatle
Date Sept. 21, 2011, 1:24 a.m.
Message ID <be1367ae4a7a8800fb0dc000f80ae083247fb8e0.1316568119.git.mark.hatle@windriver.com>
Download mbox | patch
Permalink /patch/11801/
State New, archived
Headers show

Comments

Mark Hatle - Sept. 21, 2011, 1:24 a.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 |   27 ++++++++++++++++++++++-----
 1 files changed, 22 insertions(+), 5 deletions(-)

Patch

diff --git a/meta/classes/multilib_global.bbclass b/meta/classes/multilib_global.bbclass
index ed14565..cd22163 100644
--- a/meta/classes/multilib_global.bbclass
+++ b/meta/classes/multilib_global.bbclass
@@ -6,16 +6,33 @@  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)
             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)
             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)
+                e.data.setVar("RPROVIDES_%s" % pkg, rprovs)
 }
 
 addhandler multilib_virtclass_handler_global
@@ -35,7 +52,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: