diff options
| -rw-r--r-- | bitbake/lib/bb/data_smart.py | 8 | ||||
| -rw-r--r-- | bitbake/lib/bb/tests/data.py | 5 |
2 files changed, 9 insertions, 4 deletions
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): | |||
| 750 | 750 | ||
| 751 | 751 | ||
| 752 | if flag == "_content" and local_var is not None and ":append" in local_var and not parsing: | 752 | if flag == "_content" and local_var is not None and ":append" in local_var and not parsing: |
| 753 | if not value: | ||
| 754 | value = "" | ||
| 755 | self.need_overrides() | 753 | self.need_overrides() |
| 756 | for (r, o) in local_var[":append"]: | 754 | for (r, o) in local_var[":append"]: |
| 757 | match = True | 755 | match = True |
| @@ -760,11 +758,11 @@ class DataSmart(MutableMapping): | |||
| 760 | if not o2 in self.overrides: | 758 | if not o2 in self.overrides: |
| 761 | match = False | 759 | match = False |
| 762 | if match: | 760 | if match: |
| 761 | if value is None: | ||
| 762 | value = "" | ||
| 763 | value = value + r | 763 | value = value + r |
| 764 | 764 | ||
| 765 | if flag == "_content" and local_var is not None and ":prepend" in local_var and not parsing: | 765 | if flag == "_content" and local_var is not None and ":prepend" in local_var and not parsing: |
| 766 | if not value: | ||
| 767 | value = "" | ||
| 768 | self.need_overrides() | 766 | self.need_overrides() |
| 769 | for (r, o) in local_var[":prepend"]: | 767 | for (r, o) in local_var[":prepend"]: |
| 770 | 768 | ||
| @@ -774,6 +772,8 @@ class DataSmart(MutableMapping): | |||
| 774 | if not o2 in self.overrides: | 772 | if not o2 in self.overrides: |
| 775 | match = False | 773 | match = False |
| 776 | if match: | 774 | if match: |
| 775 | if value is None: | ||
| 776 | value = "" | ||
| 777 | value = r + value | 777 | value = r + value |
| 778 | 778 | ||
| 779 | parser = None | 779 | parser = None |
diff --git a/bitbake/lib/bb/tests/data.py b/bitbake/lib/bb/tests/data.py index 7f1d3ffbbc..e667c7c7d3 100644 --- a/bitbake/lib/bb/tests/data.py +++ b/bitbake/lib/bb/tests/data.py | |||
| @@ -405,6 +405,11 @@ class TestOverrides(unittest.TestCase): | |||
| 405 | bb.data.expandKeys(self.d) | 405 | bb.data.expandKeys(self.d) |
| 406 | self.assertEqual(self.d.getVar("VERSION"), "2") | 406 | self.assertEqual(self.d.getVar("VERSION"), "2") |
| 407 | 407 | ||
| 408 | def test_append_and_unused_override(self): | ||
| 409 | # Had a bug where an unused override append could return "" instead of None | ||
| 410 | self.d.setVar("BAR:append:unusedoverride", "testvalue2") | ||
| 411 | self.assertEqual(self.d.getVar("BAR"), None) | ||
| 412 | |||
| 408 | class TestKeyExpansion(unittest.TestCase): | 413 | class TestKeyExpansion(unittest.TestCase): |
| 409 | def setUp(self): | 414 | def setUp(self): |
| 410 | self.d = bb.data.init() | 415 | self.d = bb.data.init() |
