From 1027e0e313c4743a7ddb5e192013fba5d7ad0e1c Mon Sep 17 00:00:00 2001 From: Elliot Smith Date: Tue, 12 Jul 2016 15:54:53 -0700 Subject: 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 Signed-off-by: bavery Signed-off-by: Richard Purdie --- .../toastergui/templates/builddashboard.html | 29 +++--------- bitbake/lib/toaster/toastergui/views.py | 51 +++++++++++++--------- 2 files changed, 36 insertions(+), 44 deletions(-) (limited to 'bitbake') diff --git a/bitbake/lib/toaster/toastergui/templates/builddashboard.html b/bitbake/lib/toaster/toastergui/templates/builddashboard.html index febf8af747..32212ea8d4 100644 --- a/bitbake/lib/toaster/toastergui/templates/builddashboard.html +++ b/bitbake/lib/toaster/toastergui/templates/builddashboard.html @@ -69,11 +69,11 @@ {%if build.outcome == build.SUCCEEDED%} -{% if hasImages %} -

Images

+ {% if hasArtifacts %} +

Build artifacts

{% for target in targets %} {% if target.target.is_image %} -
+

{{target.target.target}}

Packages included
@@ -81,26 +81,7 @@
Total package size
{{target.pkgsz|filtered_filesizeformat}}
- {% if target.targetHasNoImages %} -
-
-
-

- This build did not create any image files -

-

- This is probably because valid image and license manifest - files from a previous build already exist in your - build/tmp/deploy - directory. You can - also view the - license manifest information in Toaster. -

-
-
-
- {% endif %} - {% if not target.targetHasNoImages %} + {% if target.targetHasImages %}
Manifests @@ -163,7 +144,7 @@
{% endif %} {% endfor %} -{% endif %} + {% endif %} {%else%} 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 ): tgts = Target.objects.filter( build_id = build_id ).order_by( 'target' ); # set up custom target list with computed package and image data - targets = [ ] + targets = [] ntargets = 0 - targetHasNoImages = False + # True if at least one target for this build has an SDK artifact + # or image file + has_artifacts = False + for t in tgts: - elem = { } - elem[ 'target' ] = t + elem = {} + elem['target'] = t + + target_has_images = False + image_files = [] + npkg = 0 pkgsz = 0 package = None for package in Package.objects.filter(id__in = [x.package_id for x in t.target_installed_package_set.all()]): pkgsz = pkgsz + package.size - if ( package.installed_name ): + if package.installed_name: npkg = npkg + 1 - elem[ 'npkg' ] = npkg - elem[ 'pkgsz' ] = pkgsz - ti = Target_Image_File.objects.filter( target_id = t.id ) - imageFiles = [ ] + elem['npkg'] = npkg + elem['pkgsz'] = pkgsz + ti = Target_Image_File.objects.filter(target_id = t.id) for i in ti: - ndx = i.file_name.rfind( '/' ) - if ( ndx < 0 ): + ndx = i.file_name.rfind('/') + if ndx < 0: ndx = 0; - f = i.file_name[ ndx + 1: ] - imageFiles.append({ + f = i.file_name[ndx + 1:] + image_files.append({ 'id': i.id, 'path': f, 'size': i.file_size, 'suffix': i.suffix }) - if t.is_image and (len(imageFiles) <= 0 or len(t.license_manifest_path) <= 0): - targetHasNoImages = True - elem[ 'imageFiles' ] = imageFiles - elem[ 'targetHasNoImages' ] = targetHasNoImages + if len(image_files) > 0: + target_has_images = True + elem['targetHasImages'] = target_has_images + + elem['imageFiles'] = image_files elem['target_kernel_artifacts'] = t.targetkernelfile_set.all() target_sdk_files = t.targetsdkfile_set.all() - elem['target_sdk_artifacts_count'] = target_sdk_files.count() + target_sdk_artifacts_count = target_sdk_files.count() + elem['target_sdk_artifacts_count'] = target_sdk_artifacts_count elem['target_sdk_artifacts'] = target_sdk_files - targets.append( elem ) + if target_has_images or target_sdk_artifacts_count > 0: + has_artifacts = True + + targets.append(elem) ## # how many packages in this build - ignore anonymous ones @@ -528,7 +539,7 @@ def builddashboard( request, build_id ): context = { 'build' : build, 'project' : build.project, - 'hasImages' : build.has_images(), + 'hasArtifacts' : has_artifacts, 'ntargets' : ntargets, 'targets' : targets, 'recipecount' : recipeCount, -- cgit v1.2.3-54-g00ecf