From d5a808d6b3f09736a7bf2a145b82ff8f340fd500 Mon Sep 17 00:00:00 2001 From: Scott Rifenbark Date: Fri, 15 Aug 2014 09:01:49 +0300 Subject: bitbake: bitbake-user-manual-metadata.xml: Added [eventmask] flag information. Reported-by: Laszlo Papp (Bitbake rev: 38150bc53c6bda5be7194f9acd112d362506d2ea) Signed-off-by: Scott Rifenbark Signed-off-by: Richard Purdie --- .../bitbake-user-manual-metadata.xml | 25 ++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'bitbake/doc') diff --git a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml index 992f65058f..26699fc268 100644 --- a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml +++ b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml @@ -1308,8 +1308,8 @@ BitBake allows installation of event handlers within recipe and class files. Events are triggered at certain points during operation, - such as the beginning of operation against a given - .bb, the start of a given task, + such as the beginning of an operation against a given recipe + (*.bb file), the start of a given task, task failure, task success, and so forth. The intent is to make it easy to do things like email notification on build failure. @@ -1337,6 +1337,27 @@ the name of the triggered event. + + Because you probably are only interested in a subset of events, + you would likely use the [eventmask] flag + for your event handler to be sure that only certain events + trigger the handler. + Given the previous example, suppose you only wanted the + bb.build.TaskFailed event to trigger that + event handler. + Use the flag as follows: + + addhandler myclass_eventhandler + myclass_eventhandler[eventmask] = "bb.build.TaskFailed" + python myclass_eventhandler() { + from bb.event import getName + from bb import data + print("The name of the Event is %s" % getName(e)) + print("The file we run for is %s" % data.getVar('FILE', e.data, True)) + } + + + During a standard build, the following common events might occur: -- cgit v1.2.3-54-g00ecf