diff options
author | 2021-08-02 16:33:54 +0100 | |
---|---|---|
committer | 2021-08-04 10:38:40 +0100 | |
commit | 699e36c270d863258502d315ed00a1b940bfbf96 (patch) | |
tree | 10ccf3710a7a1e30fffae1176ac69af1ef151c84 /lib/bb/data_smart.py | |
parent | fff7ade48d6cb9381284b93742bb2255976d6b41 (diff) | |
download | bitbake-699e36c270d863258502d315ed00a1b940bfbf96.tar.gz |
data_smart: Fix inactive overide accidental variable value corruption
Setting something like:
BAR:append:unusedoverride
should cause BAR to be None, not "" which was what the datastore was
returning. This caused problems when mixing variables like:
RDEPENDS:${PN}:inactiveoverride
RDEPENDS:${BPN}
since key expansion would report key overlap when there was none. This
is a bug in the datastore. Fix it and add a test too.
[YOCTO #14088]
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/data_smart.py')
-rw-r--r-- | lib/bb/data_smart.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py index 43e9e7855..65528c6ae 100644 --- a/lib/bb/data_smart.py +++ b/lib/bb/data_smart.py @@ -750,8 +750,6 @@ class DataSmart(MutableMapping): if flag == "_content" and local_var is not None and ":append" in local_var and not parsing: - if not value: - value = "" self.need_overrides() for (r, o) in local_var[":append"]: match = True @@ -760,11 +758,11 @@ class DataSmart(MutableMapping): if not o2 in self.overrides: match = False if match: + if value is None: + value = "" value = value + r if flag == "_content" and local_var is not None and ":prepend" in local_var and not parsing: - if not value: - value = "" self.need_overrides() for (r, o) in local_var[":prepend"]: @@ -774,6 +772,8 @@ class DataSmart(MutableMapping): if not o2 in self.overrides: match = False if match: + if value is None: + value = "" value = r + value parser = None |