mirror of
https://git.yoctoproject.org/poky
synced 2026-04-27 12:32:13 +02:00
bitbake: toaster: correct package count
The package count was incorrect because it was counting anonymous packages. the full path of the image files was shortened to just the filename. [YOCTO 6087] [YOCTO 6091] (Bitbake rev: 06b190b2c23799bd2c9749be28e11bf5d59ed4fc) Signed-off-by: Farrell Wymore <farrell.wymore@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
9db433246f
commit
1029726121
@@ -155,7 +155,7 @@
|
||||
<h4><a href="{% url 'recipes' build.pk %}">Recipes</a> & <a href="{% url 'packages' build.pk %}">Packages</a></h4>
|
||||
<dl>
|
||||
<dt>Recipes built</dt><dd><a href="{% url 'recipes' build.pk %}">{{recipecount}}</a></dd>
|
||||
<dt>Packages built</dt><dd><a href="{% url 'packages' build.pk %}">{{build.package_set.all.count}}</a></dd>
|
||||
<dt>Packages built</dt><dd><a href="{% url 'packages' build.pk %}">{{packagecount}}</a></dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -381,42 +381,60 @@ def builds(request):
|
||||
# Each build may contain multiple targets and each target
|
||||
# may generate multiple image files. display them all.
|
||||
#
|
||||
def builddashboard(request, build_id):
|
||||
def builddashboard( request, build_id ):
|
||||
template = "builddashboard.html"
|
||||
if Build.objects.filter(pk=build_id).count() == 0 :
|
||||
return redirect(builds)
|
||||
build = Build.objects.filter(pk = build_id)[0];
|
||||
if Build.objects.filter( pk=build_id ).count( ) == 0 :
|
||||
return redirect( builds )
|
||||
build = Build.objects.filter( pk = build_id )[ 0 ];
|
||||
layerVersionId = Layer_Version.objects.filter( build = 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;
|
||||
#
|
||||
|
||||
targets = [ ]
|
||||
ntargets = 0
|
||||
hasImages = False
|
||||
for t in tgts:
|
||||
elem = { };
|
||||
elem[ 'target' ] = t;
|
||||
elem = { }
|
||||
elem[ 'target' ] = t
|
||||
if ( t.is_image ):
|
||||
hasImages = True;
|
||||
npkg = 0;
|
||||
pkgsz = 0;
|
||||
pid= 0;
|
||||
tp = Target_Installed_Package.objects.filter( target_id = t.id );
|
||||
package = None;
|
||||
hasImages = True
|
||||
npkg = 0
|
||||
pkgsz = 0
|
||||
pid= 0
|
||||
tp = Target_Installed_Package.objects.filter( target_id = t.id )
|
||||
package = None
|
||||
for p in tp:
|
||||
pid = p.package_id;
|
||||
pid = p.package_id
|
||||
package = Package.objects.get( pk = p.package_id )
|
||||
pkgsz = pkgsz + package.size;
|
||||
npkg = npkg + 1;
|
||||
elem[ 'npkg' ] = npkg;
|
||||
elem[ 'pkgsz' ] = pkgsz;
|
||||
ti = Target_Image_File.objects.filter( target_id = t.id );
|
||||
imageFiles = [ ];
|
||||
pkgsz = pkgsz + package.size
|
||||
if ( package.installed_name ):
|
||||
npkg = npkg + 1
|
||||
elem[ 'npkg' ] = npkg
|
||||
elem[ 'pkgsz' ] = pkgsz
|
||||
ti = Target_Image_File.objects.filter( target_id = t.id )
|
||||
imageFiles = [ ]
|
||||
for i in ti:
|
||||
imageFiles.append({ 'path': i.file_name, 'size' : i.file_size });
|
||||
elem[ 'imageFiles' ] = imageFiles;
|
||||
targets.append( elem );
|
||||
ndx = i.file_name.rfind( '/' )
|
||||
if ( ndx < 0 ):
|
||||
ndx = 0;
|
||||
f = i.file_name[ ndx + 1: ]
|
||||
imageFiles.append({ 'path': f, 'size' : i.file_size })
|
||||
elem[ 'imageFiles' ] = imageFiles
|
||||
targets.append( elem )
|
||||
|
||||
##
|
||||
# how many packages in this build - ignore anonymous ones
|
||||
#
|
||||
|
||||
packageCount = 0
|
||||
packages = Package.objects.filter( build_id = build_id )
|
||||
for p in packages:
|
||||
if ( p.installed_name ):
|
||||
packageCount = packageCount + 1
|
||||
|
||||
context = {
|
||||
'build' : build,
|
||||
@@ -424,9 +442,10 @@ def builddashboard(request, build_id):
|
||||
'ntargets' : ntargets,
|
||||
'targets' : targets,
|
||||
'recipecount' : recipeCount,
|
||||
'logmessages' : LogMessage.objects.filter(build=build_id),
|
||||
'packagecount' : packageCount,
|
||||
'logmessages' : LogMessage.objects.filter( build = build_id ),
|
||||
}
|
||||
return render(request, template, context)
|
||||
return render( request, template, context )
|
||||
|
||||
|
||||
def task(request, build_id, task_id):
|
||||
|
||||
Reference in New Issue
Block a user