Patchwork [bitbake-devel,76/94] bitbake: webhob: Simple visualisation for the build-time packages

login
register
mail settings
Submitter Alexandru DAMIAN
Date Sept. 24, 2013, 4:52 p.m.
Message ID <120c4325b3180b5930a16d709e6bf3bd5fb5c158.1380041477.git.alexandru.damian@intel.com>
Download mbox | patch
Permalink /patch/58793/
State New
Headers show

Comments

Alexandru DAMIAN - Sept. 24, 2013, 4:52 p.m.
From: Alexandru DAMIAN <alexandru.damian@intel.com>

Adding pages and views to allow viewing the data collected
about the build-time packages.

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
---
 .../webhob/bldviewer/templates/basebuildpage.html  | 17 ++++++++++
 .../lib/webhob/bldviewer/templates/bpackage.html   | 36 ++++++++++++++++++++++
 .../lib/webhob/bldviewer/templates/package.html    | 10 ------
 bitbake/lib/webhob/bldviewer/views.py              |  9 +++++-
 4 files changed, 61 insertions(+), 11 deletions(-)
 create mode 100644 bitbake/lib/webhob/bldviewer/templates/basebuildpage.html
 create mode 100644 bitbake/lib/webhob/bldviewer/templates/bpackage.html

Patch

diff --git a/bitbake/lib/webhob/bldviewer/templates/basebuildpage.html b/bitbake/lib/webhob/bldviewer/templates/basebuildpage.html
new file mode 100644
index 0000000..478019b
--- /dev/null
+++ b/bitbake/lib/webhob/bldviewer/templates/basebuildpage.html
@@ -0,0 +1,17 @@ 
+{% extends "basetable.html" %}
+
+{% block pagename %}
+<ul class="nav nav-tabs" style="display: inline-block">
+  <li><a>Build {{build.target_set.all|join:"&nbsp;"}} at {{build.started_on}} : </a></li>
+  <li><a href="/simple/build/{{build.id}}/task/"> Tasks </a></li>
+  <li><a href="/simple/build/{{build.id}}/packages/"> Build Packages </a></li>
+    {% for t in build.target_set.all %}
+        {% if t.is_image %}
+  <li><a href="/simple/build/{{build.id}}/target/{{t.pk}}/packages/"> Packages for {{t.target}} </a> </li>
+        {% endif %}
+    {% endfor %}
+  <li><a href="/simple/build/{{build.id}}/configuration/"> Configuration </a> </li>
+</ul>
+     <h1>Toaster - Build {% block pagetitle %} {% endblock %}</h1>
+{% endblock %}
+
diff --git a/bitbake/lib/webhob/bldviewer/templates/bpackage.html b/bitbake/lib/webhob/bldviewer/templates/bpackage.html
new file mode 100644
index 0000000..4e6cb00
--- /dev/null
+++ b/bitbake/lib/webhob/bldviewer/templates/bpackage.html
@@ -0,0 +1,36 @@ 
+{% extends "basebuildpage.html" %}
+
+{% block pagetable %}
+    {% if not packages %}
+        <p>No packages were recorded for this target!</p>
+    {% else %}
+
+            <tr>
+            <th>Name</th>
+            <th>Version</th>
+            <th>Revision</th>
+            <th>Recipe</th>
+            <th>Summary</th>
+            <th>Section</th>
+            <th>Description</th>
+            <th>License</th>
+            </tr>
+
+            {% for package in packages %}
+
+            <tr class="data">
+                <td><a name="#{{package.name}}">{{package.name}}</a></td>
+                <td>{{package.version}}</td>
+                <td>{{package.revision}}</td>
+                <td><a href="/simple/layerversions/{{package.recipe.layer_version_id}}/recipes/#{{package.recipe.name}}">{{package.recipe.name}}</a>{{package.package_name}}</a></td>
+                
+            <td>{{package.summary}}</td>
+            <td>{{package.section}}</td>
+            <td>{{package.description}}</td>
+            <td>{{package.license}}</td>
+
+            {% endfor %}
+
+    {% endif %}
+
+{% endblock %}
diff --git a/bitbake/lib/webhob/bldviewer/templates/package.html b/bitbake/lib/webhob/bldviewer/templates/package.html
index cba21e1..4ce25ae 100644
--- a/bitbake/lib/webhob/bldviewer/templates/package.html
+++ b/bitbake/lib/webhob/bldviewer/templates/package.html
@@ -1,15 +1,5 @@ 
 {% extends "basebuildpage.html" %}
 
-{% block pagename %}
-<ul class="nav nav-tabs" style="display: inline-block">
-  <li><a>Build {{build}} : </a></li>
-  <li><a href="/simple/build/{{build}}/task/"> Tasks </a></li>
-  <li><a href="/simple/build/{{build}}/package/"> Package </a> </li>
-  <li><a href="/simple/build/{{build}}/configuration/"> Configuration </a> </li>
-</ul>
-     <h1>Toaster - Target Install Packages</h1>
-{% endblock %}
-
 {% block pagetable %}
     {% if not packages %}
         <p>No packages were recorded for this target!</p>
diff --git a/bitbake/lib/webhob/bldviewer/views.py b/bitbake/lib/webhob/bldviewer/views.py
index cfc2a89..a1da8b3 100644
--- a/bitbake/lib/webhob/bldviewer/views.py
+++ b/bitbake/lib/webhob/bldviewer/views.py
@@ -3,7 +3,7 @@  import operator
 from django.db.models import Q
 from django.shortcuts import render
 from orm.models import Build, Task, Layer, Layer_Version, Recipe, Target_Package, LogMessage, Variable
-from orm.models import Task_Dependency, Target_Package_Dependency
+from orm.models import Task_Dependency, Target_Package_Dependency, Build_Package
 from django.views.decorators.cache import cache_control
 
 @cache_control(no_store=True)
@@ -36,6 +36,13 @@  def configuration(request, build_id):
     context = {'build': Build.objects.filter(pk=build_id)[0], 'configuration' : variables}
     return render(request, template, context)
 
+
+def bpackage(request, build_id):
+    template = 'bpackage.html'
+    packages = Build_Package.objects.filter(build = build_id)
+    context = {'build': Build.objects.filter(pk=build_id)[0], 'packages' : packages}
+    return render(request, template, context)
+
 def tpackage(request, build_id, target_id):
     template = 'package.html'