https://docs.yoctoproject.org/bitbake/bitbake-user-manual/bitbake-user-manual-metadata.html#promoting-a-function-to-a-task Bitbake does not like this python task - we should at least try to show valid examples ;) python do_printdate () { import time print time.strftime('%Y%m%d', time.gmtime()) } addtask printdate after do_fetch before do_build Not sure what exactly we'll try to show here but maybe it is more like this: python do_printdate () { - import time - print time.strftime('%Y%m%d', time.gmtime()) + import datetime + bb.plain('Date: %s' % (datetime.date.today())) } addtask printdate after do_fetch before do_build With bb.plain it shows up in the cooker shell and not just in some log file like with print. This would of course need additional explanations. In case we would like to show even more maybe something like this, or a subset of it: # this is a python task: python do_printdate () { import datetime # goes to cooker shell: bb.warn('py: --> S: %s <--' % (d.getVar("S", True))) bb.plain('py: Date: %s' % (datetime.date.today())) # goes to log: print(datetime.datetime.now()) print(datetime.date.today()) # goes to cooker shell: bb.plain("py: Check the logs!") bb.plain('py: this log file: %s/log.do_printdate' % (d.getVar("T", True))) } addtask do_printdate after do_compile before do_install Please advise how the example should look like.
Bulk move of 5.1 M4 to 5.2 M2 as approved by AlexB.
Fixed with commit https://git.openembedded.org/bitbake/commit/?id=874c607f475f3d60677d2720b80a28d0c2e963c6. Moving to Resolved Fixed.