From 43092d6e8d6485c9b4d4808ed8c8172504392f12 Mon Sep 17 00:00:00 2001 From: Antonin Godard Date: Fri, 4 Apr 2025 17:17:56 +0200 Subject: [PATCH] bitbake: doc/bitbake-user-manual-metadata.rst: fix python task example Fix the old Python 2 print statement, replace it by a bb.plain() call instead. Also replace time by datetime for a slightly simpler example. [YOCTO #14670] Reported-by: Robert Berger (Bitbake rev: 874c607f475f3d60677d2720b80a28d0c2e963c6) Signed-off-by: Antonin Godard Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie --- .../doc/bitbake-user-manual/bitbake-user-manual-metadata.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst index 415fbf6d69..db17491787 100644 --- a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst +++ b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst @@ -1405,8 +1405,8 @@ the task and other tasks. Here is an example that shows how to define a task and declare some dependencies:: 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