]> code.ossystems Code Review - openembedded-core.git/commitdiff
native.bbclass: Fix DEPENDS handling for BBCLASSEXTEND use
authorRichard Purdie <rpurdie@linux.intel.com>
Mon, 9 Nov 2009 16:04:51 +0000 (16:04 +0000)
committerRichard Purdie <rpurdie@linux.intel.com>
Fri, 13 Nov 2009 12:15:28 +0000 (12:15 +0000)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
meta/classes/native.bbclass

index 8a5e5f133f5a4db69bee4df3ccf998392f845bcf..6b5a5919b2a6f8daf87cd7a110dfff0959c878c5 100644 (file)
@@ -82,46 +82,38 @@ do_stage () {
 PKG_CONFIG_PATH .= "${EXTRA_NATIVE_PKGCONFIG_PATH}"
 PKG_CONFIG_SYSROOT_DIR = ""
 
+ORIG_DEPENDS := "${DEPENDS}"
+
+DEPENDS_virtclass-native ?= "${ORIG_DEPENDS}"
+
 python __anonymous () {
     # If we've a legacy native do_stage, we need to neuter do_install
     stagefunc = bb.data.getVar('do_stage', d, True)
     if (stagefunc.strip() != "do_stage_native" and stagefunc.strip() != "autotools_stage_all") and bb.data.getVar('AUTOTOOLS_NATIVE_STAGE_INSTALL', d, 1) == "1":
         bb.data.setVar("do_install", "      :", d)
 
-    pn = bb.data.getVar("PN", d, True)
-    depends = bb.data.getVar("DEPENDS", d, True)
-    deps = bb.utils.explode_deps(depends)
-    newdeps = []
     if "native" in (bb.data.getVar('BBCLASSEXTEND', d, True) or ""):
-        autoextend = True
-    else:
-        autoextend = False
-    for dep in deps:
-        if dep.endswith("-cross"):
-            if autoextend:
+        pn = bb.data.getVar("PN", d, True)
+        depends = bb.data.getVar("DEPENDS_virtclass-native", d, True)
+        deps = bb.utils.explode_deps(depends)
+        newdeps = []
+        for dep in deps:
+            if dep.endswith("-cross"):
                 newdeps.append(dep.replace("-cross", "-native"))
-            else:
-                bb.note("%s has depends %s which ends in -cross?" % (pn, dep))
-                newdeps.append(dep)
-        elif not dep.endswith("-native"):
-            if autoextend:
+            elif not dep.endswith("-native"):
+     
                 newdeps.append(dep + "-native")
             else:
-                bb.note("%s has depends %s which doesn't end in -native?" % (pn, dep))
                 newdeps.append(dep)
-        else:
-            newdeps.append(dep)
-    bb.data.setVar("DEPENDS", " ".join(newdeps), d)
-    provides = bb.data.getVar("PROVIDES", d, True)
-    for prov in provides.split():
-        if prov.find(pn) != -1:
-            continue
-        if not prov.endswith("-native"):
-            if autoextend:
+        bb.data.setVar("DEPENDS_virtclass-native", " ".join(newdeps), d)
+        provides = bb.data.getVar("PROVIDES", d, True)
+        for prov in provides.split():
+            if prov.find(pn) != -1:
+                continue
+            if not prov.endswith("-native"):
+    
                 provides = provides.replace(prov, prov + "-native")
-            #else:
-            #    bb.note("%s has rouge PROVIDES of %s which doesn't end in -sdk?" % (pn, prov))
-    bb.data.setVar("PROVIDES", provides, d)
-    bb.data.setVar("OVERRIDES", bb.data.getVar("OVERRIDES", d, False) + ":virtclass-native", d)
+        bb.data.setVar("PROVIDES", provides, d)
+        bb.data.setVar("OVERRIDES", bb.data.getVar("OVERRIDES", d, False) + ":virtclass-native", d)
 }