[OE-core] [PATCH 1/1] classextend.py: update filter to support multiple multilib items

kai.kang at windriver.com kai.kang at windriver.com
Fri Nov 13 02:32:47 UTC 2015


From: Kai Kang <kai.kang at windriver.com>

If it is set with two or more mutliblib items, such as:

MULTILIBS = "multilib:lib32 multilib:lib64"

it expands some virtual providers wrongly:

| ERROR: Nothing PROVIDES 'virtual/lib32-lib64-libc'.

Update the filter that do not extend variables which already have
one of mulitlib prefixes.

Signed-off-by: Kai Kang <kai.kang at windriver.com>
---
 meta/lib/oe/classextend.py | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/meta/lib/oe/classextend.py b/meta/lib/oe/classextend.py
index 5107ecd..6a6affb 100644
--- a/meta/lib/oe/classextend.py
+++ b/meta/lib/oe/classextend.py
@@ -15,10 +15,10 @@ class ClassExtender(object):
             name = name.replace("-" + self.extname, "")
         if name.startswith("virtual/"):
             subs = name.split("/", 1)[1]
-            if not subs.startswith(self.extname):
+            if not self.check_prefix(subs):
                 return "virtual/" + self.extname + "-" + subs
             return name
-        if not name.startswith(self.extname):
+        if not self.check_prefix(name):
             return self.extname + "-" + name
         return name
 
@@ -57,13 +57,6 @@ class ClassExtender(object):
         if dep.endswith(("-native", "-native-runtime")) or ('nativesdk-' in dep) or ('cross-canadian' in dep) or ('-crosssdk-' in dep):
             return dep
         else:
-            # Do not extend for that already have multilib prefix
-            var = self.d.getVar("MULTILIB_VARIANTS", True)
-            if var:
-                var = var.split()
-                for v in var:
-                    if dep.startswith(v):
-                        return dep
             return self.extend_name(dep)
 
     def map_depends_variable(self, varname, suffix = ""):
@@ -108,6 +101,16 @@ class ClassExtender(object):
             for subs in variables:
                 self.d.renameVar("%s_%s" % (subs, pkg_mapping[0]), "%s_%s" % (subs, pkg_mapping[1]))
 
+    def check_prefix(self, name):
+        ml_prefixes = (self.d.getVar("MULTILIB_VARIANTS", True) or "").split()
+        if self.extname in ml_prefixes:
+            for var in ml_prefixes:
+                if name.startswith(var):
+                    return True
+            return False
+        else:
+            return name.startswith(self.extname)
+
 class NativesdkClassExtender(ClassExtender):
     def map_depends(self, dep):
         if dep.startswith(self.extname):
-- 
2.6.1




More information about the Openembedded-core mailing list