summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Bergin <peter@berginkonsult.se>2021-01-29 10:50:54 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-02-10 23:55:53 +0000
commit39897a745ad5c93c4a67aa269978edafae50ff3d (patch)
treeeb4ea8c62e17c2f4e16270782ba23a54f806e868
parenteb295a81f5831d5cc1054661ac92469d01efc4ae (diff)
downloadpoky-39897a745ad5c93c4a67aa269978edafae50ff3d.tar.gz
buildhistory.bbclass: avoid exception for empty BUILDHISTORY_FEATURES variable
An exception is fired when a BuildStarted event is sent to buildhistory bbclass and the variable BUILDHISTORY_FEATURES is not set. ERROR: Execution of event handler 'buildhistory_eventhandler' failed Traceback (most recent call last): File "<...>/meta/classes/buildhistory.bbclass", line 862, in buildhistory_eventhandler(e=<bb.event.BuildStarted object at 0x7f94c3810250>): python buildhistory_eventhandler() { > if e.data.getVar('BUILDHISTORY_FEATURES').strip(): reset = e.data.getVar("BUILDHISTORY_RESET") AttributeError: 'NoneType' object has no attribute 'strip' This can happen in a multiconfig build where the default configuration use the buildhistory class but not the configuration in mc. It should be a rare case that this happens and it was found in a missconfigured build. (From OE-Core rev: 6b5ff13fcbcfe980b50893a8bfe86ebf7a4ef3bf) Signed-off-by: Peter Bergin <peter@berginkonsult.se> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit a74e30a4de02c8efd3e7102ba7a4fe06df53cc34) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/buildhistory.bbclass2
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 156324d339..8a1359acbe 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -852,7 +852,7 @@ END
852} 852}
853 853
854python buildhistory_eventhandler() { 854python buildhistory_eventhandler() {
855 if e.data.getVar('BUILDHISTORY_FEATURES').strip(): 855 if (e.data.getVar('BUILDHISTORY_FEATURES') or "").strip():
856 reset = e.data.getVar("BUILDHISTORY_RESET") 856 reset = e.data.getVar("BUILDHISTORY_RESET")
857 olddir = e.data.getVar("BUILDHISTORY_OLD_DIR") 857 olddir = e.data.getVar("BUILDHISTORY_OLD_DIR")
858 if isinstance(e, bb.event.BuildStarted): 858 if isinstance(e, bb.event.BuildStarted):