From 60cba6a0735d8f8ef690fc2e5db9148066cb18f6 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Tue, 6 Aug 2024 20:30:37 +0100 Subject: bitbake: BBHandler: Handle comments in addtask/deltask Technically our syntax would allow for comments after an addtask/deltask. Currently these get silently processed in various ways by the code which is bad. Tweak the regex to drop any comments and add test cases to ensure this continues to work in the future. [YOCTO #15250] (Bitbake rev: 64f8796e55a8826ffec0d76b993c8256713f67a3) Signed-off-by: Richard Purdie --- bitbake/lib/bb/tests/parse.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'bitbake/lib/bb/tests') diff --git a/bitbake/lib/bb/tests/parse.py b/bitbake/lib/bb/tests/parse.py index 72d1962e7e..d076fcc208 100644 --- a/bitbake/lib/bb/tests/parse.py +++ b/bitbake/lib/bb/tests/parse.py @@ -179,6 +179,15 @@ python () { addtask do_patch after do_foo after do_unpack before do_configure before do_compile addtask do_fetch do_patch +addtask do_myplaintask +addtask do_myplaintask2 +deltask do_myplaintask2 +addtask do_mytask# comment +addtask do_mytask2 # comment2 +addtask do_mytask3 +deltask do_mytask3# comment +deltask do_mytask4 # comment2 + MYVAR = "do_patch" EMPTYVAR = "" deltask do_fetch ${MYVAR} ${EMPTYVAR} @@ -195,6 +204,7 @@ deltask ${EMPTYVAR} self.assertTrue("addtask contained multiple 'before' keywords" in output) self.assertTrue("addtask contained multiple 'after' keywords" in output) self.assertTrue('addtask ignored: " do_patch"' in output) + self.assertEqual(['do_myplaintask', 'do_mytask', 'do_mytask2'], d.getVar("__BBTASKS")) #self.assertTrue('dependent task do_foo for do_patch does not exist' in output) broken_multiline_comment = """ -- cgit v1.2.3-54-g00ecf