]> code.ossystems Code Review - openembedded-core.git/commitdiff
multilib/clsextend: Improve handling of regexps in PACKAGES_DYNAMIC
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 22 Oct 2012 12:20:04 +0000 (12:20 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 22 Oct 2012 13:57:26 +0000 (14:57 +0100)
Now that PACKAGES_DYNAMIC is more standardised, starting with ^ anchors,
the variable manipulations performed by clsextend for multilib don't work.

This patch at least improves it to hack around the problem and enable
mulitlib builds to work again. If this code doesn't do the right thing, the
recipe is free to override the variable with the correct multilib case.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/multilib.bbclass
meta/lib/oe/classextend.py

index eaaad5fa62f87e400e85b1685191a89f1e122c1f..3824f3b1177669ceb5b8c383b9b288cd0d175913 100644 (file)
@@ -75,7 +75,7 @@ python __anonymous () {
     clsextend.map_depends_variable("DEPENDS")
     clsextend.map_packagevars()
     clsextend.map_variable("PROVIDES")
-    clsextend.map_variable("PACKAGES_DYNAMIC")
+    clsextend.map_regexp_variable("PACKAGES_DYNAMIC")
     clsextend.map_variable("PACKAGE_INSTALL")
     clsextend.map_variable("INITSCRIPT_PACKAGES")
 }
index 86b1e8a554970abc325315937b727a25c13f83a2..857a6c97efda92bf3a5c831d19fe0fe6095d0768 100644 (file)
@@ -33,6 +33,22 @@ class ClassExtender(object):
             self.d.setVar(varname, newdata)
         return newdata
 
+    def map_regexp_variable(self, varname, setvar = True):
+        var = self.d.getVar(varname, True)
+        if not var:
+            return ""
+        var = var.split()
+        newvar = []
+        for v in var:
+            if v.startswith("^"):
+                newvar.append("^" + self.extname + "-" + v[1:])
+            else:
+                newvar.append(self.extend_name(v))
+        newdata =  " ".join(newvar)
+        if setvar:
+            self.d.setVar(varname, newdata)
+        return newdata
+
     def map_depends(self, dep):
         if dep.endswith(("-native", "-native-runtime")):
             return dep