diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2009-07-21 22:38:53 +0100 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2009-07-21 22:38:53 +0100 |
commit | fa5d458526716a047a70dc89dbce7bea2c8179bb (patch) | |
tree | 60e2663de0810f27f0319bd0e0b58bd7831e59fc /bitbake/lib/bb/runqueue.py | |
parent | 502bd2ef92f6cddf74ac85279dab621372791dc0 (diff) | |
download | openembedded-core-fa5d458526716a047a70dc89dbce7bea2c8179bb.tar.gz openembedded-core-fa5d458526716a047a70dc89dbce7bea2c8179bb.tar.bz2 openembedded-core-fa5d458526716a047a70dc89dbce7bea2c8179bb.zip |
bitbake: Factor some runqueue code into common functions making things more readable
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/runqueue.py')
-rw-r--r-- | bitbake/lib/bb/runqueue.py | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index 2f204aea97..20187f3219 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py @@ -345,6 +345,33 @@ class RunQueue: # process is repeated for each type of dependency (tdepends, deptask, # rdeptast, recrdeptask, idepends). + def add_build_dependencies(depids, tasknames, depends): + for depid in depids: + # Won't be in build_targets if ASSUME_PROVIDED + if depid not in taskData.build_targets: + continue + depdata = taskData.build_targets[depid][0] + if depdata is None: + continue + dep = taskData.fn_index[depdata] + for taskname in tasknames: + taskid = taskData.gettask_id(dep, taskname, False) + if taskid is not None: + depends.append(taskid) + + def add_runtime_dependencies(depids, tasknames, depends): + for depid in depids: + if depid not in taskData.run_targets: + continue + depdata = taskData.run_targets[depid][0] + if depdata is None: + continue + dep = taskData.fn_index[depdata] + for taskname in tasknames: + taskid = taskData.gettask_id(dep, taskname, False) + if taskid is not None: + depends.append(taskid) + for task in range(len(taskData.tasks_name)): depends = [] recrdepends = [] @@ -367,14 +394,7 @@ class RunQueue: # (makes sure sometask runs after someothertask of all DEPENDS) if 'deptask' in task_deps and taskData.tasks_name[task] in task_deps['deptask']: tasknames = task_deps['deptask'][taskData.tasks_name[task]].split() - for depid in taskData.depids[fnid]: - # Won't be in build_targets if ASSUME_PROVIDED - if depid in taskData.build_targets: - depdata = taskData.build_targets[depid][0] - if depdata is not None: - dep = taskData.fn_index[depdata] - for taskname in tasknames: - depends.append(taskData.gettask_id(dep, taskname)) + add_build_dependencies(taskData.depids[fnid], tasknames, depends) # Resolve 'rdeptask' dependencies # @@ -382,12 +402,7 @@ class RunQueue: # (makes sure sometask runs after someothertask of all RDEPENDS) if 'rdeptask' in task_deps and taskData.tasks_name[task] in task_deps['rdeptask']: taskname = task_deps['rdeptask'][taskData.tasks_name[task]] - for depid in taskData.rdepids[fnid]: - if depid in taskData.run_targets: - depdata = taskData.run_targets[depid][0] - if depdata is not None: - dep = taskData.fn_index[depdata] - depends.append(taskData.gettask_id(dep, taskname)) + add_runtime_dependencies(taskData.rdepids[fnid], [taskname], depends) # Resolve inter-task dependencies # @@ -416,23 +431,8 @@ class RunQueue: if 'recrdeptask' in task_deps and taskData.tasks_name[task] in task_deps['recrdeptask']: for taskname in task_deps['recrdeptask'][taskData.tasks_name[task]].split(): recrdepends.append(taskname) - for depid in taskData.rdepids[fnid]: - if depid in taskData.run_targets: - depdata = taskData.run_targets[depid][0] - if depdata is not None: - dep = taskData.fn_index[depdata] - taskid = taskData.gettask_id(dep, taskname, False) - if taskid is not None: - depends.append(taskid) - for depid in taskData.depids[fnid]: - # Won't be in build_targets if ASSUME_PROVIDED - if depid in taskData.build_targets: - depdata = taskData.build_targets[depid][0] - if depdata is not None: - dep = taskData.fn_index[depdata] - taskid = taskData.gettask_id(dep, taskname, False) - if taskid is not None: - depends.append(taskid) + add_build_dependencies(taskData.depids[fnid], [taskname], depends) + add_runtime_dependencies(taskData.rdepids[fnid], [taskname], depends) # Rmove all self references if task in depends: |