]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
native: Implement BBCLASSEXTEND PACKAGES_DYNAMIC handling
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 25 Jan 2023 16:31:07 +0000 (16:31 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 26 Jan 2023 21:05:58 +0000 (21:05 +0000)
Recipes that use native BBCLASSEXTEND and set PACKAGES_DYNAMIC will
currently see PREFERRED_PROVIDER warnings. Some recipes work around this
but lets fix the core code to handle remapping PACKAGES_DYNAMIC correctly
so the workarounds aren't necessary any more.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-recipe/native.bbclass

index 1e94585f3e37b8cfc4ab248e38fe2d6c1a8452b7..cfd299d0c8c584af280486021256299f158ad7fd 100644 (file)
@@ -139,7 +139,7 @@ python native_virtclass_handler () {
     if "native" not in classextend:
         return
 
-    def map_dependencies(varname, d, suffix = "", selfref=True):
+    def map_dependencies(varname, d, suffix = "", selfref=True, regex=False):
         if suffix:
             varname = varname + ":" + suffix
         deps = d.getVar(varname)
@@ -148,7 +148,9 @@ python native_virtclass_handler () {
         deps = bb.utils.explode_deps(deps)
         newdeps = []
         for dep in deps:
-            if dep == pn:
+            if regex and dep.startswith("^") and dep.endswith("$"):
+                newdeps.append(dep[:-1].replace(pn, bpn) + "-native$")
+            elif dep == pn:
                 if not selfref:
                     continue
                 newdeps.append(dep)
@@ -171,6 +173,7 @@ python native_virtclass_handler () {
         map_dependencies("RPROVIDES", e.data, pkg)
         map_dependencies("RREPLACES", e.data, pkg)
     map_dependencies("PACKAGES", e.data)
+    map_dependencies("PACKAGES_DYNAMIC", e.data, regex=True)
 
     provides = e.data.getVar("PROVIDES")
     nprovides = []