summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/build.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-12-18 10:45:02 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-12-18 17:08:07 +0000
commitba82035412d5dec2ce6f8a459ee52da48b1afe32 (patch)
tree2669fa096510cb8bfb691843c47ce96222538219 /bitbake/lib/bb/build.py
parent8a82a3835cb5b38812da720914d5f47a7cd443e8 (diff)
downloadpoky-ba82035412d5dec2ce6f8a459ee52da48b1afe32.tar.gz
bitbake: build/ast: Create strong task add/del API in bb.build
Currently its near impossible to control task addition/deletion from metadata context. This adds stong add/deltask API to bb.build which is traditionally where it resided. The rather broken remove_tasks function was removed, it didn't appear to do anything useful or have any users. This allows us to clean up hacks currently in use in metadata and use standard API for it instead. (Bitbake rev: bf7138dd38fc1f8efca80891198e3422fef64093) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/build.py')
-rw-r--r--bitbake/lib/bb/build.py37
1 files changed, 32 insertions, 5 deletions
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py
index 6b395264b6..1524da0049 100644
--- a/bitbake/lib/bb/build.py
+++ b/bitbake/lib/bb/build.py
@@ -668,9 +668,36 @@ def add_tasks(tasklist, deltasklist, d):
668 # don't assume holding a reference 668 # don't assume holding a reference
669 d.setVar('_task_deps', task_deps) 669 d.setVar('_task_deps', task_deps)
670 670
671def remove_task(task, kill, d): 671def addtask(task, before, after, d):
672 """Remove an BB 'task'. 672 if task[:3] != "do_":
673 task = "do_" + task
674
675 d.setVarFlag(task, "task", 1)
676 bbtasks = d.getVar('__BBTASKS') or []
677 if not task in bbtasks:
678 bbtasks.append(task)
679 d.setVar('__BBTASKS', bbtasks)
680
681 existing = d.getVarFlag(task, "deps") or []
682 if after is not None:
683 # set up deps for function
684 for entry in after.split():
685 if entry not in existing:
686 existing.append(entry)
687 d.setVarFlag(task, "deps", existing)
688 if before is not None:
689 # set up things that depend on this func
690 for entry in before.split():
691 existing = d.getVarFlag(entry, "deps") or []
692 if task not in existing:
693 d.setVarFlag(entry, "deps", [task] + existing)
694
695def deltask(task, d):
696 if task[:3] != "do_":
697 task = "do_" + task
698
699 bbtasks = d.getVar('__BBDELTASKS') or []
700 if not task in bbtasks:
701 bbtasks.append(task)
702 d.setVar('__BBDELTASKS', bbtasks)
673 703
674 If kill is 1, also remove tasks that depend on this task."""
675
676 d.delVarFlag(task, 'task')