From 997b11a5a12fec2bf43c431052f431edc51c8fe6 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Mon, 12 Aug 2024 15:54:46 +0100 Subject: bitbake: build: Ensure addtask before/after tasknames have prefix applied "addtask do_XXX before YYY after ZZZ " where YYY or ZZZ is missing the "do_" prefix don't work as expected. Ajust the code so that it doesn't just silently do the wrong thing but works as expected. Expand a test case to cover this. (Bitbake rev: 21670b9bb8936ec44aedff26163948bbc2ceb44a) Signed-off-by: Richard Purdie --- bitbake/lib/bb/tests/parse.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'bitbake/lib/bb/tests') diff --git a/bitbake/lib/bb/tests/parse.py b/bitbake/lib/bb/tests/parse.py index 97df2c4590..410679d5a1 100644 --- a/bitbake/lib/bb/tests/parse.py +++ b/bitbake/lib/bb/tests/parse.py @@ -188,6 +188,9 @@ addtask do_mytask3 deltask do_mytask3# comment deltask do_mytask4 # comment2 +# Ensure a missing task prefix on after works +addtask do_mytask5 after mytask + MYVAR = "do_patch" EMPTYVAR = "" deltask do_fetch ${MYVAR} ${EMPTYVAR} @@ -198,7 +201,8 @@ deltask ${EMPTYVAR} f = self.parsehelper(self.addtask_deltask) d = bb.parse.handle(f.name, self.d)[''] - self.assertEqual(['do_fetch2', 'do_patch2', 'do_myplaintask', 'do_mytask', 'do_mytask2'], d.getVar("__BBTASKS")) + self.assertEqual(['do_fetch2', 'do_patch2', 'do_myplaintask', 'do_mytask', 'do_mytask2', 'do_mytask5'], d.getVar("__BBTASKS")) + self.assertEqual(['do_mytask'], d.getVarFlag("do_mytask5", "deps")) broken_multiline_comment = """ # First line of comment \\ -- cgit v1.2.3-54-g00ecf