summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-12-06 00:39:20 +0000
committerChris Larson <chris_larson@mentor.com>2010-12-08 21:18:29 -0700
commitba95240541cefa0984dc506719a15929bf1157da (patch)
tree1a1eff66014724404d8da743c37f8ed3196f03f8 /lib
parent61c804d59738929b36051acd84287581611441b0 (diff)
downloadbitbake-ba95240541cefa0984dc506719a15929bf1157da.tar.gz
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 'lib')
-rw-r--r--lib/bb/data_smart.py24
1 files changed, 16 insertions, 8 deletions
diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py
index b4dffd548..abfb20da2 100644
--- a/lib/bb/data_smart.py
+++ b/lib/bb/data_smart.py
@@ -145,32 +145,40 @@ class DataSmart(MutableMapping):
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: