aboutsummaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorFarrell Wymore <farrell.wymore@windriver.com>2014-04-02 15:04:08 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-04-05 14:55:29 +0100
commit10297261219d4373843b31e8aaaed094fcbcf605 (patch)
tree49c52ac778e5a4c9bead6d48cc79a5b6bf39b718 /bitbake
parent9db433246fbab66a646ce9188d7f9b096df8552b (diff)
downloadopenembedded-core-contrib-10297261219d4373843b31e8aaaed094fcbcf605.tar.gz
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>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/toaster/toastergui/templates/builddashboard.html2
-rw-r--r--bitbake/lib/toaster/toastergui/views.py73
2 files changed, 47 insertions, 28 deletions
diff --git a/bitbake/lib/toaster/toastergui/templates/builddashboard.html b/bitbake/lib/toaster/toastergui/templates/builddashboard.html
index 891d86078b..fa4b194eb9 100644
--- a/bitbake/lib/toaster/toastergui/templates/builddashboard.html
+++ b/bitbake/lib/toaster/toastergui/templates/builddashboard.html
@@ -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>
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index e346ac4cf1..2da81c1ede 100644
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -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):