diff options
author | Koen Kooi <koen@openembedded.org> | 2009-02-17 16:59:16 +0100 |
---|---|---|
committer | Koen Kooi <koen@openembedded.org> | 2009-02-17 16:59:16 +0100 |
commit | e23256b41bb0e8d002182dde119f4a21bb5953b9 (patch) | |
tree | 586a6b19c6a9a598798a653eb3bc3922f1876995 /classes | |
parent | 1b3740d56dfddbfa7861a07fdfdc3d00f5af0637 (diff) |
failure-cleanup.bbclass: class that does -c clean on a package that fails to build
Diffstat (limited to 'classes')
-rw-r--r-- | classes/failure-cleanup.bbclass | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/classes/failure-cleanup.bbclass b/classes/failure-cleanup.bbclass new file mode 100644 index 0000000000..3870c756c8 --- /dev/null +++ b/classes/failure-cleanup.bbclass @@ -0,0 +1,18 @@ +# This class clean a package on failure, a nice way to keep diskspace usage down and force rebuilds + +# we want to be an event handler +addhandler failure_eventhandler +python failure_eventhandler() { + from bb import build, event, note, error, data + from bb.event import NotHandled, getName + + if e.data is None or getName(e) == "MsgNote": + return NotHandled + + name = getName(e) + if name == "PkgFailed": + bb.note("Exectuting -c clean on failed build") + build.exec_func('do_clean', e.data) + + return NotHandled +} |