aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-06-22 12:51:29 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-06-25 14:15:02 +0100
commitdb65080a6199baecc5c422294a4c4a9fd12dc29e (patch)
tree95d282106c60529ac214360221c071970e46ada2
parentab6d71ebfcfb7bedc064b25f84647c8815096e5a (diff)
downloadbitbake-db65080a6199baecc5c422294a4c4a9fd12dc29e.tar.gz
bitbake-db65080a6199baecc5c422294a4c4a9fd12dc29e.tar.bz2
bitbake-db65080a6199baecc5c422294a4c4a9fd12dc29e.zip
taskdata.py: Add support for rdepends task flag
Currently its not possible to add arbitrary RDEPENDS to a specific task. This can be useful and this patch adds functionality equivalent to the 'depends' task flag. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/build.py1
-rw-r--r--lib/bb/runqueue.py14
-rw-r--r--lib/bb/taskdata.py16
3 files changed, 30 insertions, 1 deletions
diff --git a/lib/bb/build.py b/lib/bb/build.py
index a0a7dd4e..2cb7a930 100644
--- a/lib/bb/build.py
+++ b/lib/bb/build.py
@@ -543,6 +543,7 @@ def add_tasks(tasklist, d):
deptask = data.expand(flags[name], d)
task_deps[name][task] = deptask
getTask('depends')
+ getTask('rdepends')
getTask('deptask')
getTask('rdeptask')
getTask('recrdeptask')
diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py
index bd643ea7..03766adf 100644
--- a/lib/bb/runqueue.py
+++ b/lib/bb/runqueue.py
@@ -476,7 +476,19 @@ class RunQueueData:
depends.append(taskid)
if depdata != fnid:
tdepends_fnid[fnid].add(taskid)
-
+ irdepends = taskData.tasks_irdepends[task]
+ for (depid, idependtask) in irdepends:
+ if depid in taskData.run_targets:
+ # Won't be in run_targets if ASSUME_PROVIDED
+ depdata = taskData.run_targets[depid][0]
+ if depdata is not None:
+ dep = taskData.fn_index[depdata]
+ taskid = taskData.gettask_id(dep, idependtask, False)
+ if taskid is None:
+ bb.msg.fatal("RunQueue", "Task %s in %s rdepends upon non-existent task %s in %s" % (taskData.tasks_name[task], fn, idependtask, dep))
+ depends.append(taskid)
+ if depdata != fnid:
+ tdepends_fnid[fnid].add(taskid)
# Resolve recursive 'recrdeptask' dependencies (A)
#
diff --git a/lib/bb/taskdata.py b/lib/bb/taskdata.py
index ee1a7232..8bc447c1 100644
--- a/lib/bb/taskdata.py
+++ b/lib/bb/taskdata.py
@@ -55,6 +55,7 @@ class TaskData:
self.tasks_name = []
self.tasks_tdepends = []
self.tasks_idepends = []
+ self.tasks_irdepends = []
# Cache to speed up task ID lookups
self.tasks_lookup = {}
@@ -134,6 +135,7 @@ class TaskData:
self.tasks_fnid.append(fnid)
self.tasks_tdepends.append([])
self.tasks_idepends.append([])
+ self.tasks_irdepends.append([])
listid = len(self.tasks_name) - 1
@@ -178,6 +180,15 @@ class TaskData:
bb.msg.fatal("TaskData", "Error for %s, dependency %s does not contain ':' character\n. Task 'depends' should be specified in the form 'packagename:task'" % (fn, dep))
ids.append(((self.getbuild_id(dep.split(":")[0])), dep.split(":")[1]))
self.tasks_idepends[taskid].extend(ids)
+ if 'rdepends' in task_deps and task in task_deps['rdepends']:
+ ids = []
+ for dep in task_deps['rdepends'][task].split():
+ if dep:
+ if ":" not in dep:
+ bb.msg.fatal("TaskData", "Error for %s, dependency %s does not contain ':' character\n. Task 'rdepends' should be specified in the form 'packagename:task'" % (fn, dep))
+ ids.append(((self.getrun_id(dep.split(":")[0])), dep.split(":")[1]))
+ self.tasks_irdepends[taskid].extend(ids)
+
# Work out build dependencies
if not fnid in self.depids:
@@ -533,6 +544,11 @@ class TaskData:
dependees = self.get_rdependees(targetid)
for fnid in dependees:
self.fail_fnid(fnid, missing_list)
+ for taskid in xrange(len(self.tasks_irdepends)):
+ irdepends = self.tasks_irdepends[taskid]
+ for (idependid, idependtask) in irdepends:
+ if idependid == targetid:
+ self.fail_fnid(self.tasks_fnid[taskid], missing_list)
def add_unresolved(self, cfgData, dataCache):
"""