From 92d8bd0eb5f7fc14c7e77d7f8e09f94929a15337 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Mon, 2 Aug 2021 16:33:54 +0100 Subject: bitbake: 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] (Bitbake rev: 699e36c270d863258502d315ed00a1b940bfbf96) Signed-off-by: Richard Purdie --- bitbake/lib/bb/data_smart.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'bitbake/lib/bb/data_smart.py') diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py index 43e9e78555..65528c6ae6 100644 --- a/bitbake/lib/bb/data_smart.py +++ b/bitbake/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 -- cgit v1.2.3-54-g00ecf