summaryrefslogtreecommitdiffstats
path: root/lib/bb/data_smart.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2014-05-07 10:20:17 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-05-07 10:29:45 +0100
commitd1c712fd3a59fa804e6fd451612c30487671f3a2 (patch)
tree163fb62723144804f2a648495c6bf92cb157fe2f /lib/bb/data_smart.py
parent4eb2dc8048e2722d64d589f453df1ce6262c71b8 (diff)
downloadbitbake-contrib-d1c712fd3a59fa804e6fd451612c30487671f3a2.tar.gz
data_smart: Ensure all possible overrides are cached including those with '_' in the name
Unfortunately we've been neglecting to pay the correct tributes to the cookie monster and hence the datastore is malfunctioning. Currently tributes are only paid on the last part of a variable after the last "_" character. We need to split by *all* "_" characters since an override may contain the character. This fixes the code so the correct number of tributes are made. Paradoxically parsing appears to be faster after this change. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/data_smart.py')
-rw-r--r--lib/bb/data_smart.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py
index e4bdb2fdd..46a0221e1 100644
--- a/lib/bb/data_smart.py
+++ b/lib/bb/data_smart.py
@@ -513,10 +513,15 @@ class DataSmart(MutableMapping):
def _setvar_update_overrides(self, var):
# aka pay the cookie monster
override = var[var.rfind('_')+1:]
- if len(override) > 0:
+ shortvar = var[:var.rfind('_')]
+ while override:
if override not in self._seen_overrides:
self._seen_overrides[override] = set()
self._seen_overrides[override].add( var )
+ override = None
+ if "_" in shortvar:
+ override = var[shortvar.rfind('_')+1:]
+ shortvar = var[:shortvar.rfind('_')]
def getVar(self, var, expand=False, noweakdefault=False):
return self.getVarFlag(var, "_content", expand, noweakdefault)