1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-08 17:19:20 +00:00

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>
This commit is contained in:
Richard Purdie
2010-12-06 00:39:20 +00:00
parent 9d0d2b044e
commit c354955d26
+16 -8
View File
@@ -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: