diff options
author | Elliot Smith <elliot.smith@intel.com> | 2016-07-12 15:54:53 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-07-19 08:56:52 +0100 |
commit | 1027e0e313c4743a7ddb5e192013fba5d7ad0e1c (patch) | |
tree | 1e9c3f5be3bc8dd6fb80d270c21fd3943788e552 /bitbake/lib/toaster/toastergui/views.py | |
parent | adbf206526d1237c1ae99f26bb405183e06febe0 (diff) | |
download | poky-1027e0e313c4743a7ddb5e192013fba5d7ad0e1c.tar.gz |
bitbake: toaster: better display of targets which produced no images
SDK targets (populate_sdk) produce SDK artifacts but no image files.
Currently, these targets appear under the "Images" heading in the
build dashboard, even though they aren't strictly image targets.
Change the heading to "Build artifacts". Also remove the section
which states that a build produced no image files: this is not
correct for populate_sdk targets (those targets don't produce
image files under any circumstances); and other changes mean
that all targets which do produce images will now show those
files.
The check for whether to display the "Build artifacts" section also
needs to change, as we show targets here which didn't produce any
images but did produce SDK artifacts.
[YOCTO #8556]
(Bitbake rev: b4dce68045c4615e7a6a474e952f670721a3b54e)
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/views.py')
-rwxr-xr-x | bitbake/lib/toaster/toastergui/views.py | 51 |
1 files changed, 31 insertions, 20 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index 02caf54d50..baaa2883bc 100755 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py | |||
@@ -472,46 +472,57 @@ def builddashboard( request, build_id ): | |||
472 | tgts = Target.objects.filter( build_id = build_id ).order_by( 'target' ); | 472 | tgts = Target.objects.filter( build_id = build_id ).order_by( 'target' ); |
473 | 473 | ||
474 | # set up custom target list with computed package and image data | 474 | # set up custom target list with computed package and image data |
475 | targets = [ ] | 475 | targets = [] |
476 | ntargets = 0 | 476 | ntargets = 0 |
477 | 477 | ||
478 | targetHasNoImages = False | 478 | # True if at least one target for this build has an SDK artifact |
479 | # or image file | ||
480 | has_artifacts = False | ||
481 | |||
479 | for t in tgts: | 482 | for t in tgts: |
480 | elem = { } | 483 | elem = {} |
481 | elem[ 'target' ] = t | 484 | elem['target'] = t |
485 | |||
486 | target_has_images = False | ||
487 | image_files = [] | ||
488 | |||
482 | npkg = 0 | 489 | npkg = 0 |
483 | pkgsz = 0 | 490 | pkgsz = 0 |
484 | package = None | 491 | package = None |
485 | for package in Package.objects.filter(id__in = [x.package_id for x in t.target_installed_package_set.all()]): | 492 | for package in Package.objects.filter(id__in = [x.package_id for x in t.target_installed_package_set.all()]): |
486 | pkgsz = pkgsz + package.size | 493 | pkgsz = pkgsz + package.size |
487 | if ( package.installed_name ): | 494 | if package.installed_name: |
488 | npkg = npkg + 1 | 495 | npkg = npkg + 1 |
489 | elem[ 'npkg' ] = npkg | 496 | elem['npkg'] = npkg |
490 | elem[ 'pkgsz' ] = pkgsz | 497 | elem['pkgsz'] = pkgsz |
491 | ti = Target_Image_File.objects.filter( target_id = t.id ) | 498 | ti = Target_Image_File.objects.filter(target_id = t.id) |
492 | imageFiles = [ ] | ||
493 | for i in ti: | 499 | for i in ti: |
494 | ndx = i.file_name.rfind( '/' ) | 500 | ndx = i.file_name.rfind('/') |
495 | if ( ndx < 0 ): | 501 | if ndx < 0: |
496 | ndx = 0; | 502 | ndx = 0; |
497 | f = i.file_name[ ndx + 1: ] | 503 | f = i.file_name[ndx + 1:] |
498 | imageFiles.append({ | 504 | image_files.append({ |
499 | 'id': i.id, | 505 | 'id': i.id, |
500 | 'path': f, | 506 | 'path': f, |
501 | 'size': i.file_size, | 507 | 'size': i.file_size, |
502 | 'suffix': i.suffix | 508 | 'suffix': i.suffix |
503 | }) | 509 | }) |
504 | if t.is_image and (len(imageFiles) <= 0 or len(t.license_manifest_path) <= 0): | 510 | if len(image_files) > 0: |
505 | targetHasNoImages = True | 511 | target_has_images = True |
506 | elem[ 'imageFiles' ] = imageFiles | 512 | elem['targetHasImages'] = target_has_images |
507 | elem[ 'targetHasNoImages' ] = targetHasNoImages | 513 | |
514 | elem['imageFiles'] = image_files | ||
508 | elem['target_kernel_artifacts'] = t.targetkernelfile_set.all() | 515 | elem['target_kernel_artifacts'] = t.targetkernelfile_set.all() |
509 | 516 | ||
510 | target_sdk_files = t.targetsdkfile_set.all() | 517 | target_sdk_files = t.targetsdkfile_set.all() |
511 | elem['target_sdk_artifacts_count'] = target_sdk_files.count() | 518 | target_sdk_artifacts_count = target_sdk_files.count() |
519 | elem['target_sdk_artifacts_count'] = target_sdk_artifacts_count | ||
512 | elem['target_sdk_artifacts'] = target_sdk_files | 520 | elem['target_sdk_artifacts'] = target_sdk_files |
513 | 521 | ||
514 | targets.append( elem ) | 522 | if target_has_images or target_sdk_artifacts_count > 0: |
523 | has_artifacts = True | ||
524 | |||
525 | targets.append(elem) | ||
515 | 526 | ||
516 | ## | 527 | ## |
517 | # how many packages in this build - ignore anonymous ones | 528 | # how many packages in this build - ignore anonymous ones |
@@ -528,7 +539,7 @@ def builddashboard( request, build_id ): | |||
528 | context = { | 539 | context = { |
529 | 'build' : build, | 540 | 'build' : build, |
530 | 'project' : build.project, | 541 | 'project' : build.project, |
531 | 'hasImages' : build.has_images(), | 542 | 'hasArtifacts' : has_artifacts, |
532 | 'ntargets' : ntargets, | 543 | 'ntargets' : ntargets, |
533 | 'targets' : targets, | 544 | 'targets' : targets, |
534 | 'recipecount' : recipeCount, | 545 | 'recipecount' : recipeCount, |