summaryrefslogtreecommitdiffstats
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)
downloadpoky-c354955d26d34316b3dbf0e2175526838401f3b6.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 '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 b9d9476fd8..9594feebf3 100644
--- a/bitbake/lib/bb/data_smart.py
+++ b/bitbake/lib/bb/data_smart.py
@@ -157,32 +157,40 @@ class DataSmart:
157 if "_append" in self._special_values: 157 if "_append" in self._special_values:
158 appends = self._special_values["_append"] or [] 158 appends = self._special_values["_append"] or []
159 for append in appends: 159 for append in appends:
160 keep = []
160 for (a, o) in self.getVarFlag(append, "_append") or []: 161 for (a, o) in self.getVarFlag(append, "_append") or []:
161 # maybe the OVERRIDE was not yet added so keep the append
162 if (o and o in overrides) or not o:
163 self.delVarFlag(append, "_append")
164 if o and not o in overrides: 162 if o and not o in overrides:
163 keep.append((a ,o))
165 continue 164 continue
166 165
167 sval = self.getVar(append, False) or "" 166 sval = self.getVar(append, False) or ""
168 sval += a 167 sval += a
169 self.setVar(append, sval) 168 self.setVar(append, sval)
170 169 # We save overrides that may be applied at some later stage
170 if keep:
171 self.setVarFlag(append, "_append", keep)
172 else:
173 self.delVarFlag(append, "_append")
171 174
172 if "_prepend" in self._special_values: 175 if "_prepend" in self._special_values:
173 prepends = self._special_values["_prepend"] or [] 176 prepends = self._special_values["_prepend"] or []
174
175 for prepend in prepends: 177 for prepend in prepends:
178 keep = []
176 for (a, o) in self.getVarFlag(prepend, "_prepend") or []: 179 for (a, o) in self.getVarFlag(prepend, "_prepend") or []:
177 # maybe the OVERRIDE was not yet added so keep the prepend
178 if (o and o in overrides) or not o:
179 self.delVarFlag(prepend, "_prepend")
180 if o and not o in overrides: 180 if o and not o in overrides:
181 keep.append((a ,o))
181 continue 182 continue
182 183
183 sval = a + (self.getVar(prepend, False) or "") 184 sval = a + (self.getVar(prepend, False) or "")
184 self.setVar(prepend, sval) 185 self.setVar(prepend, sval)
185 186
187 # We save overrides that may be applied at some later stage
188 if keep:
189 self.setVarFlag(prepend, "_prepend", keep)
190 else:
191 self.delVarFlag(prepend, "_prepend")
192
193
186 def initVar(self, var): 194 def initVar(self, var):
187 self.expand_cache = {} 195 self.expand_cache = {}
188 if not var in self.dict: 196 if not var in self.dict: