diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-06-12 16:31:57 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-06-14 12:55:47 +0100 |
commit | 53841ce521d44c0c9cca512675a12f81a491fe52 (patch) | |
tree | 98a2ca75581f4bb488e43087b6b9128017aac135 /meta/classes/base.bbclass | |
parent | 98abb113a02a4504ae969dbaf9844ab6539dcdb8 (diff) | |
download | poky-53841ce521d44c0c9cca512675a12f81a491fe52.tar.gz |
classes/conf: Add eventmasks for event handlers
Now that bitbake supports masking events for event handlers, lets use
this so event handlers are only called for events they care about. This
lets us simplify the code indentation a bit at least as well as mildly
improving the event handling performance.
(From OE-Core rev: bff73743280f9eafebe4591f7368ead91a4eb74d)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/base.bbclass')
-rw-r--r-- | meta/classes/base.bbclass | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index 8af104f765..3a0ff6bd63 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass | |||
@@ -32,12 +32,12 @@ def oe_import(d): | |||
32 | inject(toimport.split(".", 1)[0], imported) | 32 | inject(toimport.split(".", 1)[0], imported) |
33 | 33 | ||
34 | python oe_import_eh () { | 34 | python oe_import_eh () { |
35 | if isinstance(e, bb.event.ConfigParsed): | 35 | oe_import(e.data) |
36 | oe_import(e.data) | 36 | e.data.setVar("NATIVELSBSTRING", lsb_distro_identifier(e.data)) |
37 | e.data.setVar("NATIVELSBSTRING", lsb_distro_identifier(e.data)) | ||
38 | } | 37 | } |
39 | 38 | ||
40 | addhandler oe_import_eh | 39 | addhandler oe_import_eh |
40 | oe_import_eh[eventmask] = "bb.event.ConfigParsed" | ||
41 | 41 | ||
42 | def lsb_distro_identifier(d): | 42 | def lsb_distro_identifier(d): |
43 | adjust = d.getVar('LSB_DISTRO_ADJUST', True) | 43 | adjust = d.getVar('LSB_DISTRO_ADJUST', True) |
@@ -299,6 +299,7 @@ def buildcfg_neededvars(d): | |||
299 | bb.fatal('The following variable(s) were not set: %s\nPlease set them directly, or choose a MACHINE or DISTRO that sets them.' % ', '.join(pesteruser)) | 299 | bb.fatal('The following variable(s) were not set: %s\nPlease set them directly, or choose a MACHINE or DISTRO that sets them.' % ', '.join(pesteruser)) |
300 | 300 | ||
301 | addhandler base_eventhandler | 301 | addhandler base_eventhandler |
302 | base_eventhandler[eventmask] = "bb.event.ConfigParsed bb.event.BuildStarted" | ||
302 | python base_eventhandler() { | 303 | python base_eventhandler() { |
303 | if isinstance(e, bb.event.ConfigParsed): | 304 | if isinstance(e, bb.event.ConfigParsed): |
304 | e.data.setVar('BB_VERSION', bb.__version__) | 305 | e.data.setVar('BB_VERSION', bb.__version__) |