summaryrefslogtreecommitdiffstats
path: root/lib/bb/event.py
diff options
context:
space:
mode:
authorJoshua Watt <jpewhacker@gmail.com>2021-02-19 20:37:00 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-02-20 11:16:53 +0000
commitc3168df330a4563cbd03ba74de55a22217d823ed (patch)
tree254d750298faddd2976b7b39f246dc9fda2b7e5a /lib/bb/event.py
parent915330e1dbae1ee8fd9a0358decf2c294f771961 (diff)
downloadbitbake-c3168df330a4563cbd03ba74de55a22217d823ed.tar.gz
event: Fix broken builds when multiconfig has a hyphen in the name
5f7fdf7b2d ("bitbake: event: Prevent bitbake from executing event handler for wrong multiconfig target") broke multiconfig builds contain a hyphen, since it's attempt to use the multiconfig as part of a function name and python functions are not allowed to contain a hyphen. Rework the bitbake multiconfig test to test a multiconfig with a hyphen and one with an underscore to validate this doesn't break in the future. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/event.py')
-rw-r--r--lib/bb/event.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/bb/event.py b/lib/bb/event.py
index ff8995946..23e1f3187 100644
--- a/lib/bb/event.py
+++ b/lib/bb/event.py
@@ -234,7 +234,7 @@ def register(name, handler, mask=None, filename=None, lineno=None, data=None):
if data and data.getVar("BB_CURRENT_MC"):
mc = data.getVar("BB_CURRENT_MC")
- name = '%s%s' % (mc, name)
+ name = '%s%s' % (mc.replace('-', '_'), name)
# already registered
if name in _handlers:
@@ -286,7 +286,7 @@ def remove(name, handler, data=None):
if data:
if data.getVar("BB_CURRENT_MC"):
mc = data.getVar("BB_CURRENT_MC")
- name = '%s%s' % (mc, name)
+ name = '%s%s' % (mc.replace('-', '_'), name)
_handlers.pop(name)
if name in _catchall_handlers: