1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-02 01:19:52 +00:00

bitbake: toaster: use has_images() methods to display images correctly

In the build dashboard, we had issues with showing images correctly,
as we were using the is_image property of targets to determine
whether a target would have image files. This property can
be set to True if a target refers to an image recipe
(e.g. "core-image-minimal"), even if the task used in the build
didn't produce any image files.

By adding has_images() methods to the Target and Build objects,
which count associated Target_Image_File objects,
we can correctly determine whether a target has image files
associated with it, and if any of the targets for a build has
image files. This means that we can screen out the left-hand
"Images" menu options for builds which contained image-related
targets (e.g. "core-image-minimal") but which didn't produce
any images (e.g. "rootfs" task).

[YOCTO #9500]
[YOCTO #9784]

(Bitbake rev: f6bba0ff254d5ed3163151d4b938f3a43c9acb0a)

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>
This commit is contained in:
Elliot Smith
2016-07-12 15:54:50 -07:00
committed by Richard Purdie
parent 150e5588a0
commit 587275eefd
3 changed files with 33 additions and 12 deletions
+2 -7
View File
@@ -471,19 +471,14 @@ def builddashboard( request, build_id ):
recipeCount = Recipe.objects.filter( layer_version__id__in = layerVersionId ).count( );
tgts = Target.objects.filter( build_id = build_id ).order_by( 'target' );
##
# set up custom target list with computed package and image data
#
targets = [ ]
ntargets = 0
hasImages = False
targetHasNoImages = False
for t in tgts:
elem = { }
elem[ 'target' ] = t
if t.is_image:
hasImages = True
npkg = 0
pkgsz = 0
package = None
@@ -533,7 +528,7 @@ def builddashboard( request, build_id ):
context = {
'build' : build,
'project' : build.project,
'hasImages' : hasImages,
'hasImages' : build.has_images(),
'ntargets' : ntargets,
'targets' : targets,
'recipecount' : recipeCount,