Skip to contentSkip to conversation

base: don't prefix/suffix packages when expanding PACKAGECONFIG

RFC PATCH In review Ross Burton 1 participant 2 messages Nov 30, 2015 – Dec 1, 2015

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 base: don't prefix/suffix packages when expanding PACKAGECONFIG

When handling PACKAGECONFIG don't add nativesdk- prefixes or -native suffixes to packages, as the classexpand logic will run next and so the same operation again.

Apart from removing redundant code, this also fixes a bug where the nativesdk- prefix was being added twice in some situations, resulting in dependencies on virtual/nativesdk-nativesdk-libx11.

---
 meta/classes/base.bbclass | 23 -----------------------
 1 file changed, 23 deletions(-)
meta/classes/base.bbclass +0 -23
index e6d1599..4af5ee1 100644
@@ -355,32 +355,9 @@ python () {
 
         mlprefix = d.getVar("MLPREFIX", True)
 
-        def expandFilter(appends, extension, prefix):
-            appends = bb.utils.explode_deps(d.expand(" ".join(appends)))
-            newappends = []
-            for a in appends:
-                if a.endswith("-native") or ("-cross-" in a):
-                    newappends.append(a)
-                elif a.startswith("virtual/"):
-                    subs = a.split("/", 1)[1]
-                    newappends.append("virtual/" + prefix + subs + extension)
-                else:
-                    if a.startswith(prefix):
-                        newappends.append(a + extension)
-                    else:
-                        newappends.append(prefix + a + extension)
-            return newappends
-
         def appendVar(varname, appends):
             if not appends:
                 return
-            if varname.find("DEPENDS") != -1:
-                if pn.startswith("nativesdk-"):
-                    appends = expandFilter(appends, "", "nativesdk-")
-                if pn.endswith("-native"):
-                    appends = expandFilter(appends, "-native", "")
-                if mlprefix:
-                    appends = expandFilter(appends, "", mlprefix)
             varname = d.expand(varname)
             d.appendVar(varname, " " + " ".join(appends))
 
Signature · 1 line
2.1.4
#1 lore raw
Quoted 5 lines · Ross Burton

When handling PACKAGECONFIG don't add nativesdk- prefixes or -native suffixes to
packages, as the classexpand logic will run next and so the same operation again.

Retracting this, whilst this works for nativesdk the native path is ordered differently and the remapping happens before packageconfig so libsdl-native will depend on libx11 (not libx11-native).

Ross