From c354955d26d34316b3dbf0e2175526838401f3b6 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Mon, 6 Dec 2010 00:39:20 +0000 Subject: 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 --- bitbake/lib/bb/data_smart.py | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'bitbake') diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py index b9d9476fd8..9594feebf3 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: -- cgit 1.2.3-korg