diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-10-17 11:42:28 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-10-18 10:59:27 +0100 |
commit | 9248bc1c53417e6581aa33fda683e765ad866426 (patch) | |
tree | a0ec636a8912b60922105e4a5218c2d272c592b1 /bitbake/lib/bb/data_smart.py | |
parent | f5181b36d66fb8d92b2eb9072e76aa4c13fccb33 (diff) | |
download | poky-9248bc1c53417e6581aa33fda683e765ad866426.tar.gz |
bitbake: data/data_smart: Allow getVarFlag to return the variable parser object
(Bitbake rev: 136100dc932c9019737f927d826955425134010f)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/data_smart.py')
-rw-r--r-- | bitbake/lib/bb/data_smart.py | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py index ecc71bd644..4ad0567c9a 100644 --- a/bitbake/lib/bb/data_smart.py +++ b/bitbake/lib/bb/data_smart.py | |||
@@ -722,7 +722,7 @@ class DataSmart(MutableMapping): | |||
722 | self.dict["__exportlist"]["_content"] = set() | 722 | self.dict["__exportlist"]["_content"] = set() |
723 | self.dict["__exportlist"]["_content"].add(var) | 723 | self.dict["__exportlist"]["_content"].add(var) |
724 | 724 | ||
725 | def getVarFlag(self, var, flag, expand=True, noweakdefault=False, parsing=False): | 725 | def getVarFlag(self, var, flag, expand=True, noweakdefault=False, parsing=False, retparser=False): |
726 | if flag == "_content": | 726 | if flag == "_content": |
727 | cachename = var | 727 | cachename = var |
728 | else: | 728 | else: |
@@ -798,9 +798,11 @@ class DataSmart(MutableMapping): | |||
798 | if match: | 798 | if match: |
799 | value = r + value | 799 | value = r + value |
800 | 800 | ||
801 | parser = None | ||
802 | if expand or retparser: | ||
803 | parser = self.expandWithRefs(value, cachename) | ||
801 | if expand: | 804 | if expand: |
802 | self.expand_cache[cachename] = self.expandWithRefs(value, cachename) | 805 | value = parser.value |
803 | value = self.expand_cache[cachename].value | ||
804 | 806 | ||
805 | if value and flag == "_content" and local_var is not None and "_remove" in local_var and not parsing: | 807 | if value and flag == "_content" and local_var is not None and "_remove" in local_var and not parsing: |
806 | removes = [] | 808 | removes = [] |
@@ -818,8 +820,14 @@ class DataSmart(MutableMapping): | |||
818 | filtered = filter(lambda v: v not in removes, | 820 | filtered = filter(lambda v: v not in removes, |
819 | __whitespace_split__.split(value)) | 821 | __whitespace_split__.split(value)) |
820 | value = "".join(filtered) | 822 | value = "".join(filtered) |
821 | if expand and cachename in self.expand_cache: | 823 | if parser: |
822 | self.expand_cache[cachename].value = value | 824 | parser.value = value |
825 | |||
826 | if parser: | ||
827 | self.expand_cache[cachename] = parser | ||
828 | |||
829 | if retparser: | ||
830 | return value, parser | ||
823 | 831 | ||
824 | return value | 832 | return value |
825 | 833 | ||