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 | poky-fa5d458526716a047a70dc89dbce7bea2c8179bb.tar.gz | |
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: | |||
| 345 | # process is repeated for each type of dependency (tdepends, deptask, | 345 | # process is repeated for each type of dependency (tdepends, deptask, |
| 346 | # rdeptast, recrdeptask, idepends). | 346 | # rdeptast, recrdeptask, idepends). |
| 347 | 347 | ||
| 348 | def add_build_dependencies(depids, tasknames, depends): | ||
| 349 | for depid in depids: | ||
| 350 | # Won't be in build_targets if ASSUME_PROVIDED | ||
| 351 | if depid not in taskData.build_targets: | ||
| 352 | continue | ||
| 353 | depdata = taskData.build_targets[depid][0] | ||
| 354 | if depdata is None: | ||
| 355 | continue | ||
| 356 | dep = taskData.fn_index[depdata] | ||
| 357 | for taskname in tasknames: | ||
| 358 | taskid = taskData.gettask_id(dep, taskname, False) | ||
| 359 | if taskid is not None: | ||
| 360 | depends.append(taskid) | ||
| 361 | |||
| 362 | def add_runtime_dependencies(depids, tasknames, depends): | ||
| 363 | for depid in depids: | ||
| 364 | if depid not in taskData.run_targets: | ||
| 365 | continue | ||
| 366 | depdata = taskData.run_targets[depid][0] | ||
| 367 | if depdata is None: | ||
| 368 | continue | ||
| 369 | dep = taskData.fn_index[depdata] | ||
| 370 | for taskname in tasknames: | ||
| 371 | taskid = taskData.gettask_id(dep, taskname, False) | ||
| 372 | if taskid is not None: | ||
| 373 | depends.append(taskid) | ||
| 374 | |||
| 348 | for task in range(len(taskData.tasks_name)): | 375 | for task in range(len(taskData.tasks_name)): |
| 349 | depends = [] | 376 | depends = [] |
| 350 | recrdepends = [] | 377 | recrdepends = [] |
| @@ -367,14 +394,7 @@ class RunQueue: | |||
| 367 | # (makes sure sometask runs after someothertask of all DEPENDS) | 394 | # (makes sure sometask runs after someothertask of all DEPENDS) |
| 368 | if 'deptask' in task_deps and taskData.tasks_name[task] in task_deps['deptask']: | 395 | if 'deptask' in task_deps and taskData.tasks_name[task] in task_deps['deptask']: |
| 369 | tasknames = task_deps['deptask'][taskData.tasks_name[task]].split() | 396 | tasknames = task_deps['deptask'][taskData.tasks_name[task]].split() |
| 370 | for depid in taskData.depids[fnid]: | 397 | add_build_dependencies(taskData.depids[fnid], tasknames, depends) |
| 371 | # Won't be in build_targets if ASSUME_PROVIDED | ||
| 372 | if depid in taskData.build_targets: | ||
| 373 | depdata = taskData.build_targets[depid][0] | ||
| 374 | if depdata is not None: | ||
| 375 | dep = taskData.fn_index[depdata] | ||
| 376 | for taskname in tasknames: | ||
| 377 | depends.append(taskData.gettask_id(dep, taskname)) | ||
| 378 | 398 | ||
| 379 | # Resolve 'rdeptask' dependencies | 399 | # Resolve 'rdeptask' dependencies |
| 380 | # | 400 | # |
| @@ -382,12 +402,7 @@ class RunQueue: | |||
| 382 | # (makes sure sometask runs after someothertask of all RDEPENDS) | 402 | # (makes sure sometask runs after someothertask of all RDEPENDS) |
| 383 | if 'rdeptask' in task_deps and taskData.tasks_name[task] in task_deps['rdeptask']: | 403 | if 'rdeptask' in task_deps and taskData.tasks_name[task] in task_deps['rdeptask']: |
| 384 | taskname = task_deps['rdeptask'][taskData.tasks_name[task]] | 404 | taskname = task_deps['rdeptask'][taskData.tasks_name[task]] |
| 385 | for depid in taskData.rdepids[fnid]: | 405 | add_runtime_dependencies(taskData.rdepids[fnid], [taskname], depends) |
| 386 | if depid in taskData.run_targets: | ||
| 387 | depdata = taskData.run_targets[depid][0] | ||
| 388 | if depdata is not None: | ||
| 389 | dep = taskData.fn_index[depdata] | ||
| 390 | depends.append(taskData.gettask_id(dep, taskname)) | ||
| 391 | 406 | ||
| 392 | # Resolve inter-task dependencies | 407 | # Resolve inter-task dependencies |
| 393 | # | 408 | # |
| @@ -416,23 +431,8 @@ class RunQueue: | |||
| 416 | if 'recrdeptask' in task_deps and taskData.tasks_name[task] in task_deps['recrdeptask']: | 431 | if 'recrdeptask' in task_deps and taskData.tasks_name[task] in task_deps['recrdeptask']: |
| 417 | for taskname in task_deps['recrdeptask'][taskData.tasks_name[task]].split(): | 432 | for taskname in task_deps['recrdeptask'][taskData.tasks_name[task]].split(): |
| 418 | recrdepends.append(taskname) | 433 | recrdepends.append(taskname) |
| 419 | for depid in taskData.rdepids[fnid]: | 434 | add_build_dependencies(taskData.depids[fnid], [taskname], depends) |
| 420 | if depid in taskData.run_targets: | 435 | add_runtime_dependencies(taskData.rdepids[fnid], [taskname], depends) |
| 421 | depdata = taskData.run_targets[depid][0] | ||
| 422 | if depdata is not None: | ||
| 423 | dep = taskData.fn_index[depdata] | ||
| 424 | taskid = taskData.gettask_id(dep, taskname, False) | ||
| 425 | if taskid is not None: | ||
| 426 | depends.append(taskid) | ||
| 427 | for depid in taskData.depids[fnid]: | ||
| 428 | # Won't be in build_targets if ASSUME_PROVIDED | ||
| 429 | if depid in taskData.build_targets: | ||
| 430 | depdata = taskData.build_targets[depid][0] | ||
| 431 | if depdata is not None: | ||
| 432 | dep = taskData.fn_index[depdata] | ||
| 433 | taskid = taskData.gettask_id(dep, taskname, False) | ||
| 434 | if taskid is not None: | ||
| 435 | depends.append(taskid) | ||
| 436 | 436 | ||
| 437 | # Rmove all self references | 437 | # Rmove all self references |
| 438 | if task in depends: | 438 | if task in depends: |
