diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-09-06 20:14:25 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-09-06 22:31:32 +0100 |
commit | e92b2dbfcdf6ac8380485d0d688ba21a5d2c1527 (patch) | |
tree | 3516522d611844767fcedae87af256be7a33d3be /bitbake/lib/bb | |
parent | ed3ef0823fde89371a473d20c0127c0bd16d062b (diff) | |
download | poky-e92b2dbfcdf6ac8380485d0d688ba21a5d2c1527.tar.gz |
bitbake: data_smart: Move getVar expand cache handing to fix _remove operations
DISTRO_FEATURES_remove = "opengl" wasn't working as expected. The reason
turned out the be the indirect reference to opengl and the fact _remove was
operating on unexpanded data.
This patch rearranges some code to ensure we operate on expanded data
by moving the expand cache handing into getVarFlags instead of getVar.
(Bitbake rev: 181899bd9665f74f8d1b22d2453616ad30d26d9e)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r-- | bitbake/lib/bb/data_smart.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py index d32501821d..20e33a4870 100644 --- a/bitbake/lib/bb/data_smart.py +++ b/bitbake/lib/bb/data_smart.py | |||
@@ -505,12 +505,7 @@ class DataSmart(MutableMapping): | |||
505 | self._seen_overrides[override].add( var ) | 505 | self._seen_overrides[override].add( var ) |
506 | 506 | ||
507 | def getVar(self, var, expand=False, noweakdefault=False): | 507 | def getVar(self, var, expand=False, noweakdefault=False): |
508 | value = self.getVarFlag(var, "_content", False, noweakdefault) | 508 | return self.getVarFlag(var, "_content", expand, noweakdefault) |
509 | |||
510 | # Call expand() separately to make use of the expand cache | ||
511 | if expand and value: | ||
512 | return self.expand(value, var) | ||
513 | return value | ||
514 | 509 | ||
515 | def renameVar(self, key, newkey, **loginfo): | 510 | def renameVar(self, key, newkey, **loginfo): |
516 | """ | 511 | """ |
@@ -587,7 +582,11 @@ class DataSmart(MutableMapping): | |||
587 | elif flag == "_content" and "defaultval" in local_var and not noweakdefault: | 582 | elif flag == "_content" and "defaultval" in local_var and not noweakdefault: |
588 | value = copy.copy(local_var["defaultval"]) | 583 | value = copy.copy(local_var["defaultval"]) |
589 | if expand and value: | 584 | if expand and value: |
590 | value = self.expand(value, None) | 585 | # Only getvar (flag == _content) hits the expand cache |
586 | cachename = None | ||
587 | if flag == "_content": | ||
588 | cachename = var | ||
589 | value = self.expand(value, cachename) | ||
591 | if value and flag == "_content" and local_var and "_removeactive" in local_var: | 590 | if value and flag == "_content" and local_var and "_removeactive" in local_var: |
592 | filtered = filter(lambda v: v not in local_var["_removeactive"], | 591 | filtered = filter(lambda v: v not in local_var["_removeactive"], |
593 | value.split(" ")) | 592 | value.split(" ")) |