diff options
Diffstat (limited to 'bitbake/lib/toaster/toastergui/views.py')
-rw-r--r-- | bitbake/lib/toaster/toastergui/views.py | 64 |
1 files changed, 42 insertions, 22 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index 2da81c1ede..910b3b9532 100644 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py | |||
@@ -448,38 +448,58 @@ def builddashboard( request, build_id ): | |||
448 | return render( request, template, context ) | 448 | return render( request, template, context ) |
449 | 449 | ||
450 | 450 | ||
451 | def task(request, build_id, task_id): | 451 | def generateCoveredList( task ): |
452 | template = "task.html" | 452 | revList = _find_task_revdep( task ); |
453 | if Task.objects.filter(pk=task_id).count() == 0 : | 453 | list = { }; |
454 | return redirect(builds) | 454 | for t in revList: |
455 | task = Task.objects.filter(pk=task_id)[0] | 455 | if ( t.outcome == Task.OUTCOME_COVERED ): |
456 | 456 | list.update( generateCoveredList( t )); | |
457 | dependencies = sorted(_find_task_dep(task), key=lambda t:'%s_%s %s'%(t.recipe.name, t.recipe.version, t.task_name)) | 457 | else: |
458 | reverse_dependencies = sorted(_find_task_revdep(task), key=lambda t:'%s_%s %s'%(t.recipe.name, t.recipe.version, t.task_name)) | 458 | list[ t.task_name ] = t; |
459 | return( list ); | ||
459 | 460 | ||
461 | def task( request, build_id, task_id ): | ||
462 | template = "task.html" | ||
463 | tasks = Task.objects.filter( pk=task_id ) | ||
464 | if tasks.count( ) == 0: | ||
465 | return redirect( builds ) | ||
466 | task = tasks[ 0 ]; | ||
467 | dependencies = sorted( | ||
468 | _find_task_dep( task ), | ||
469 | key=lambda t:'%s_%s %s'%(t.recipe.name, t.recipe.version, t.task_name)) | ||
470 | reverse_dependencies = sorted( | ||
471 | _find_task_revdep( task ), | ||
472 | key=lambda t:'%s_%s %s'%( t.recipe.name, t.recipe.version, t.task_name )) | ||
473 | coveredBy = ''; | ||
474 | if ( task.outcome == Task.OUTCOME_COVERED ): | ||
475 | dict = generateCoveredList( task ) | ||
476 | coveredBy = [ ] | ||
477 | for name, t in dict.items( ): | ||
478 | coveredBy.append( t ) | ||
460 | log_head = '' | 479 | log_head = '' |
461 | log_body = '' | 480 | log_body = '' |
462 | if task.outcome == task.OUTCOME_FAILED: | 481 | if task.outcome == task.OUTCOME_FAILED: |
463 | pass | 482 | pass |
464 | # FIXME: the log should be read from the orm_logmessage table. | ||
465 | # This will be fixed when the backend is done. | ||
466 | 483 | ||
467 | context = { | 484 | context = { |
468 | 'build' : Build.objects.filter(pk=build_id)[0], | 485 | 'build' : Build.objects.filter( pk = build_id )[ 0 ], |
469 | 'object': task, | 486 | 'object' : task, |
470 | 'task':task, | 487 | 'task' : task, |
471 | 'deps': dependencies, | 488 | 'covered_by' : coveredBy, |
472 | 'rdeps': reverse_dependencies, | 489 | 'deps' : dependencies, |
473 | 'log_head':log_head, | 490 | 'rdeps' : reverse_dependencies, |
474 | 'log_body':log_body, | 491 | 'log_head' : log_head, |
475 | 'showing_matches':False, | 492 | 'log_body' : log_body, |
493 | 'showing_matches' : False, | ||
476 | } | 494 | } |
495 | if request.GET.get( 'show_matches', "" ): | ||
496 | context[ 'showing_matches' ] = True | ||
497 | context[ 'matching_tasks' ] = Task.objects.filter( | ||
498 | sstate_checksum=task.sstate_checksum ).filter( | ||
499 | build__completed_on__lt=task.build.completed_on ).order_by('-build__completed_on') | ||
477 | 500 | ||
478 | if request.GET.get('show_matches', ""): | 501 | return render( request, template, context ) |
479 | context['showing_matches'] = True | ||
480 | context['matching_tasks'] = Task.objects.filter(sstate_checksum=task.sstate_checksum).filter(build__completed_on__lt=task.build.completed_on).order_by('-build__completed_on') | ||
481 | 502 | ||
482 | return render(request, template, context) | ||
483 | 503 | ||
484 | def recipe(request, build_id, recipe_id): | 504 | def recipe(request, build_id, recipe_id): |
485 | template = "recipe.html" | 505 | template = "recipe.html" |