diff options
| author | Joshua Watt <jpewhacker@gmail.com> | 2021-02-19 20:37:00 -0600 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-02-21 22:02:01 +0000 |
| commit | 40f5a289d5f3fd8b1d0f3ee1544531b85f5ab350 (patch) | |
| tree | 682b115929d4f7327289826cfcc9604d12f181a0 /bitbake/lib/bb/event.py | |
| parent | 90e5cce0e31ed40c17b6cfed46945c8536c99ee3 (diff) | |
| download | poky-40f5a289d5f3fd8b1d0f3ee1544531b85f5ab350.tar.gz | |
bitbake: 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.
(Bitbake rev: c3168df330a4563cbd03ba74de55a22217d823ed)
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/event.py')
| -rw-r--r-- | bitbake/lib/bb/event.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py index ff89959460..23e1f3187b 100644 --- a/bitbake/lib/bb/event.py +++ b/bitbake/lib/bb/event.py | |||
| @@ -234,7 +234,7 @@ def register(name, handler, mask=None, filename=None, lineno=None, data=None): | |||
| 234 | 234 | ||
| 235 | if data and data.getVar("BB_CURRENT_MC"): | 235 | if data and data.getVar("BB_CURRENT_MC"): |
| 236 | mc = data.getVar("BB_CURRENT_MC") | 236 | mc = data.getVar("BB_CURRENT_MC") |
| 237 | name = '%s%s' % (mc, name) | 237 | name = '%s%s' % (mc.replace('-', '_'), name) |
| 238 | 238 | ||
| 239 | # already registered | 239 | # already registered |
| 240 | if name in _handlers: | 240 | if name in _handlers: |
| @@ -286,7 +286,7 @@ def remove(name, handler, data=None): | |||
| 286 | if data: | 286 | if data: |
| 287 | if data.getVar("BB_CURRENT_MC"): | 287 | if data.getVar("BB_CURRENT_MC"): |
| 288 | mc = data.getVar("BB_CURRENT_MC") | 288 | mc = data.getVar("BB_CURRENT_MC") |
| 289 | name = '%s%s' % (mc, name) | 289 | name = '%s%s' % (mc.replace('-', '_'), name) |
| 290 | 290 | ||
| 291 | _handlers.pop(name) | 291 | _handlers.pop(name) |
| 292 | if name in _catchall_handlers: | 292 | if name in _catchall_handlers: |
