summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/build.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py
index c08ef8904d..0d0100a064 100644
--- a/bitbake/lib/bb/build.py
+++ b/bitbake/lib/bb/build.py
@@ -878,3 +878,30 @@ def preceedtask(task, with_recrdeptasks, d):
878 if recrdeptask: 878 if recrdeptask:
879 preceed.update(recrdeptask.split()) 879 preceed.update(recrdeptask.split())
880 return preceed 880 return preceed
881
882def tasksbetween(task_start, task_end, d):
883 """
884 Return the list of tasks between two tasks in the current recipe,
885 where task_start is to start at and task_end is the task to end at
886 (and task_end has a dependency chain back to task_start).
887 """
888 outtasks = []
889 tasks = list(filter(lambda k: d.getVarFlag(k, "task"), d.keys()))
890 def follow_chain(task, endtask, chain=None):
891 if not chain:
892 chain = []
893 chain.append(task)
894 for othertask in tasks:
895 if othertask == task:
896 continue
897 if task == endtask:
898 for ctask in chain:
899 if ctask not in outtasks:
900 outtasks.append(ctask)
901 else:
902 deps = d.getVarFlag(othertask, 'deps', False)
903 if task in deps:
904 follow_chain(othertask, endtask, chain)
905 chain.pop()
906 follow_chain(task_start, task_end)
907 return outtasks