diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-03-26 15:09:06 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-03-27 09:42:07 +0000 |
commit | b015b64a9dfa3c8891f2862628663f8a51eb4029 (patch) | |
tree | afc006ee6cb1a26382f30e60d54ccd364031980b /meta | |
parent | 2651e11cae308ecbda16d844105218e8bbcd7213 (diff) | |
download | poky-b015b64a9dfa3c8891f2862628663f8a51eb4029.tar.gz |
sanity.bbclass: Update against bitbake sanity event changes
Bitbake will now trigger sanity events when it needs the checks to run in all cases
so we can drop the ConfigParsed hook. We now control whether events are generated
or errors are raised from the event itself.
(From OE-Core rev: 97108a5647f9278280c923ef69d2b0b945a26eef)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/sanity.bbclass | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass index d79db8f800..cf514d0c23 100644 --- a/meta/classes/sanity.bbclass +++ b/meta/classes/sanity.bbclass | |||
@@ -779,20 +779,19 @@ def copy_data(e): | |||
779 | return sanity_data | 779 | return sanity_data |
780 | 780 | ||
781 | addhandler check_sanity_eventhandler | 781 | addhandler check_sanity_eventhandler |
782 | check_sanity_eventhandler[eventmask] = "bb.event.ConfigParsed bb.event.SanityCheck bb.event.NetworkTest" | 782 | check_sanity_eventhandler[eventmask] = "bb.event.SanityCheck bb.event.NetworkTest" |
783 | python check_sanity_eventhandler() { | 783 | python check_sanity_eventhandler() { |
784 | if bb.event.getName(e) == "ConfigParsed" and e.data.getVar("BB_WORKERCONTEXT", True) != "1" and e.data.getVar("DISABLE_SANITY_CHECKS", True) != "1": | 784 | if bb.event.getName(e) == "SanityCheck": |
785 | sanity_data = copy_data(e) | 785 | sanity_data = copy_data(e) |
786 | reparse = check_sanity(sanity_data) | 786 | if e.generateevents: |
787 | e.data.setVar("BB_INVALIDCONF", reparse) | 787 | sanity_data.setVar("SANITY_USE_EVENTS", "1") |
788 | elif bb.event.getName(e) == "SanityCheck": | ||
789 | sanity_data = copy_data(e) | ||
790 | sanity_data.setVar("SANITY_USE_EVENTS", "1") | ||
791 | reparse = check_sanity(sanity_data) | 788 | reparse = check_sanity(sanity_data) |
792 | e.data.setVar("BB_INVALIDCONF", reparse) | 789 | e.data.setVar("BB_INVALIDCONF", reparse) |
793 | bb.event.fire(bb.event.SanityCheckPassed(), e.data) | 790 | bb.event.fire(bb.event.SanityCheckPassed(), e.data) |
794 | elif bb.event.getName(e) == "NetworkTest": | 791 | elif bb.event.getName(e) == "NetworkTest": |
795 | sanity_data = copy_data(e) | 792 | sanity_data = copy_data(e) |
793 | if e.generateevents: | ||
794 | sanity_data.setVar("SANITY_USE_EVENTS", "1") | ||
796 | bb.event.fire(bb.event.NetworkTestFailed() if check_connectivity(sanity_data) else bb.event.NetworkTestPassed(), e.data) | 795 | bb.event.fire(bb.event.NetworkTestFailed() if check_connectivity(sanity_data) else bb.event.NetworkTestPassed(), e.data) |
797 | 796 | ||
798 | return | 797 | return |