bitbake: toaster: added file types to the Outputs column in the build

The file types are displayed in the Outputs column in the build page. The file types
are derived from the target image filenames.

[YOCTO #5947]

(Bitbake rev: 842abf6759894690d5bc770f4ea2ac15b127e5e2)

Signed-off-by: Farrell Wymore <farrell.wymore@windriver.com>
Signed-off-by: David Reyna <David.Reyna@windriver.com>
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
David Reyna 2014-03-25 10:42:55 -07:00 committed by Richard Purdie
parent 877dcd709e
commit bae133add9
3 changed files with 36 additions and 3 deletions

View File

@ -122,7 +122,11 @@
<td class="warnings_no">{% if build.warnings_no %}<a class="warnings_no warning" href="{% url "builddashboard" build.id %}#warnings">{{build.warnings_no}} warning{{build.warnings_no|pluralize}}</a>{%endif%}</td>
<td class="time"><a href="{% url "buildtime" build.id %}">{{build.timespent|sectohms}}</a></td>
<td class="log">{{build.cooker_log_path}}</td>
<td class="output">{% if build.outcome == 0 %}{% for t in build.target_set.all %}{% if t.is_image %}<a href="{%url "builddashboard" build.id%}#images">TODO: compute image output fstypes</a>{% endif %}{% endfor %}{% endif %}</td>
<td class="output">
{% if build.outcome == build.SUCCEEDED %}
<a href="{%url "builddashboard" build.id%}#images">{{fstypes|get_dict_value:build.id}}</a>
{% endif %}
</td>
</tr>
{% endfor %}

View File

@ -240,3 +240,12 @@ def format_vpackage_namehelp(name):
r += ' title="' + name + ' only has dependency information available.">'
r += '</i>'
return mark_safe(r)
@register.filter
def get_dict_value(dictionary, key):
""" return the value of a dictionary key
"""
try:
return dictionary[key]
except KeyError:
return ''

View File

@ -19,13 +19,13 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import operator
import operator,re
from django.db.models import Q, Sum
from django.shortcuts import render, redirect
from orm.models import Build, Target, Task, Layer, Layer_Version, Recipe, LogMessage, Variable
from orm.models import Task_Dependency, Recipe_Dependency, Package, Package_File, Package_Dependency
from orm.models import Target_Installed_Package, Target_Image_File
from orm.models import Target_Installed_Package, Target_File, Target_Image_File
from django.views.decorators.cache import cache_control
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.http import HttpResponseBadRequest
@ -231,6 +231,25 @@ def builds(request):
else:
b.eta = 0
# set up list of fstypes for each build
fstypes_map = {};
for build in build_info:
targets = Target.objects.filter( build_id = build.id )
comma = "";
extensions = "";
for t in targets:
if ( not t.is_image ):
continue
tif = Target_Image_File.objects.filter( target_id = t.id )
for i in tif:
s=re.sub('.*tar.bz2', 'tar.bz2', i.file_name)
if s == i.file_name:
s=re.sub('.*\.', '', i.file_name)
if None == re.search(s,extensions):
extensions += comma + s
comma = ", "
fstypes_map[build.id]=extensions
# send the data to the template
context = {
# specific info for
@ -238,6 +257,7 @@ def builds(request):
# TODO: common objects for all table views, adapt as needed
'objects' : build_info,
'objectname' : "builds",
'fstypes' : fstypes_map,
'search_term' : search_term,
'total_count' : queryset_with_search.count(),
# Specifies the display of columns for the table, appearance in "Edit columns" box, toggling default show/hide, and specifying filters for columns