summaryrefslogtreecommitdiff
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-12-06 00:39:20 +0000
committerRichard Purdie <rpurdie@linux.intel.com>2010-12-07 12:16:16 +0000
commitc354955d26d34316b3dbf0e2175526838401f3b6 (patch)
treeac7e287b4d3610abb2f73b36cebb4e899734b5d9 /bitbake
parent9d0d2b044edf8bf2ffaec6f2423b5d7bddb528f2 (diff)
downloadopenembedded-core-c354955d26d34316b3dbf0e2175526838401f3b6.tar.gz
openembedded-core-c354955d26d34316b3dbf0e2175526838401f3b6.tar.bz2
openembedded-core-c354955d26d34316b3dbf0e2175526838401f3b6.tar.xz
openembedded-core-c354955d26d34316b3dbf0e2175526838401f3b6.zip
bitbake/data_smart: Fix append/prepend/override ordering issue
Where a variable name consisted of an append/prepend combined with an override and there was also an append/prepend to the variable, the override could be lost if the override was not in OVERRIDES. For example: FOO = "A" FOO_append = "B" FOO_append_virtclass-native = "C" could result in "AB" even though virtclass-native was in OVERRIDES. With this patch applied, the result is "ABC" as would be expected. The problem was the deletion of the _append/_prepend flag was happening if *any* append/prepend was procesed, the result should really be that it should contain any unprocessed append/prepend. Kevin Tian deserves credit for looking into this and working out the problem here. Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/data_smart.py24
1 files changed, 16 insertions, 8 deletions
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py
index b9d9476fd..9594feebf 100644
--- a/bitbake/lib/bb/data_smart.py
+++ b/bitbake/lib/bb/data_smart.py
@@ -157,32 +157,40 @@ class DataSmart:
if "_append" in self._special_values:
appends = self._special_values["_append"] or []
for append in appends:
+ keep = []
for (a, o) in self.getVarFlag(append, "_append") or []:
- # maybe the OVERRIDE was not yet added so keep the append
- if (o and o in overrides) or not o:
- self.delVarFlag(append, "_append")
if o and not o in overrides:
+ keep.append((a ,o))
continue
sval = self.getVar(append, False) or ""
sval += a
self.setVar(append, sval)
-
+ # We save overrides that may be applied at some later stage
+ if keep:
+ self.setVarFlag(append, "_append", keep)
+ else:
+ self.delVarFlag(append, "_append")
if "_prepend" in self._special_values:
prepends = self._special_values["_prepend"] or []
-
for prepend in prepends:
+ keep = []
for (a, o) in self.getVarFlag(prepend, "_prepend") or []:
- # maybe the OVERRIDE was not yet added so keep the prepend
- if (o and o in overrides) or not o:
- self.delVarFlag(prepend, "_prepend")
if o and not o in overrides:
+ keep.append((a ,o))
continue
sval = a + (self.getVar(prepend, False) or "")
self.setVar(prepend, sval)
+ # We save overrides that may be applied at some later stage
+ if keep:
+ self.setVarFlag(prepend, "_prepend", keep)
+ else:
+ self.delVarFlag(prepend, "_prepend")
+
+
def initVar(self, var):
self.expand_cache = {}
if not var in self.dict: