summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorFarrell Wymore <farrell.wymore@windriver.com>2014-03-11 14:48:52 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-03-17 13:59:38 +0000
commitd40ac966b22e1fa1956d8f2fe37fd55fa670e88f (patch)
tree00f0114da6396c1cbbbed18b2bc28382bf118571 /bitbake
parent3cbe113771c5beef69ffce5bc98ff664d67b84b3 (diff)
downloadpoky-d40ac966b22e1fa1956d8f2fe37fd55fa670e88f.tar.gz
bitbake: toaster: added file types to the Outputs column in the build page
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: 37ae4e94d6991d4f05b0236b525e29797ed6e49c) 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/build.html6
-rw-r--r--bitbake/lib/toaster/toastergui/templatetags/projecttags.py27
2 files changed, 32 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/toastergui/templates/build.html b/bitbake/lib/toaster/toastergui/templates/build.html
index 3c9256cbd0..f1fa70d068 100644
--- a/bitbake/lib/toaster/toastergui/templates/build.html
+++ b/bitbake/lib/toaster/toastergui/templates/build.html
@@ -92,7 +92,11 @@
92 <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> 92 <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>
93 <td class="time"><a href="{% url "buildtime" build.id %}">{{build.timespent|sectohms}}</a></td> 93 <td class="time"><a href="{% url "buildtime" build.id %}">{{build.timespent|sectohms}}</a></td>
94 <td class="log">{{build.cooker_log_path}}</td> 94 <td class="log">{{build.cooker_log_path}}</td>
95 <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> 95 <td class="output">
96 {% if build.outcome == 0 %}
97 {{build|get_image_extensions}}
98 {% endif %}
99 </td>
96 </tr> 100 </tr>
97 101
98 {% endfor %} 102 {% endfor %}
diff --git a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py
index 857680b350..60d5dd0b7c 100644
--- a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py
+++ b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py
@@ -24,6 +24,8 @@ import re
24from django import template 24from django import template
25from django.utils import timezone 25from django.utils import timezone
26from django.template.defaultfilters import filesizeformat 26from django.template.defaultfilters import filesizeformat
27from orm.models import Target_Installed_Package, Target_Image_File
28from orm.models import Build, Target, Task, Layer, Layer_Version
27 29
28register = template.Library() 30register = template.Library()
29 31
@@ -188,3 +190,28 @@ def string_slice(strvar,slicevar):
188 else: 190 else:
189 return strvar[int(first):int(last)] 191 return strvar[int(first):int(last)]
190 192
193@register.filter
194def get_image_extensions( build ):
195 """
196 This is a simple filter that returns a list (string)
197 of extensions of the build-targets-image files. Note
198 that each build can have multiple targets and each
199 target can yield more than one image file
200 """
201 targets = Target.objects.filter( build_id = build.id );
202 comma = "";
203 extensions = "";
204 for t in targets:
205 if ( not t.is_image ):
206 continue;
207 tif = Target_Image_File.objects.filter( target_id = t.id );
208 for i in tif:
209 try:
210 ndx = i.file_name.index( "." );
211 except ValueError:
212 ndx = 0;
213 s = i.file_name[ ndx + 1 : ];
214 extensions += comma + s;
215 comma = ", ";
216 return( extensions );
217