summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/bldviewer
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2013-11-26 18:12:43 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-12-10 11:16:12 +0000
commit54d0e30433c249604611367cf387bc20721c4523 (patch)
tree8f576220f0a4627a763d663089c9ebc0f4b29884 /bitbake/lib/toaster/bldviewer
parentf8120984f459d193ce5ffa243137baf0e38d223e (diff)
downloadpoky-54d0e30433c249604611367cf387bc20721c4523.tar.gz
bitbake: toaster: change package storage model
Up until this patch, package information lived in two places - one table for build packages and one table for target installed packaged. This situation leads to two problems: there is no direct link between a build package and a installed package, and a lot of data is duplicated. This change unifies all package types in a single table. The SimpleUI remains the same for continuity sake, but the REST API will be changed in a future patch. The package dependencies and package files are now kept in a single table. Since we collect target installed package information at all times, we need to expand it to supplement missing information if a package is not actually built in the current build. Small changes to the Simple UI reflect the updated database schema. [YOCTO #5565] [YOCTO #5269] (Bitbake rev: f5d655bfaeb349c8680d74530617e34aa389d1f0) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/bldviewer')
-rw-r--r--bitbake/lib/toaster/bldviewer/templates/bpackage.html6
-rw-r--r--bitbake/lib/toaster/bldviewer/templates/package.html2
-rw-r--r--bitbake/lib/toaster/bldviewer/views.py25
3 files changed, 15 insertions, 18 deletions
diff --git a/bitbake/lib/toaster/bldviewer/templates/bpackage.html b/bitbake/lib/toaster/bldviewer/templates/bpackage.html
index 4e6d9c6778..ca092ca6a0 100644
--- a/bitbake/lib/toaster/bldviewer/templates/bpackage.html
+++ b/bitbake/lib/toaster/bldviewer/templates/bpackage.html
@@ -23,7 +23,7 @@
23 <tr class="data"> 23 <tr class="data">
24 <td><a name="#{{package.name}}" href="{% url bfile build.pk package.pk %}">{{package.name}} ({{package.filelist_bpackage.count}} files)</a></td> 24 <td><a name="#{{package.name}}" href="{% url bfile build.pk package.pk %}">{{package.name}} ({{package.filelist_bpackage.count}} files)</a></td>
25 <td>{{package.version}}-{{package.revision}}</td> 25 <td>{{package.version}}-{{package.revision}}</td>
26 <td><a href="{% url layer_versions_recipes package.recipe.layer_version_id %}#{{package.recipe.name}}">{{package.recipe.name}}</a>{{package.package_name}}</a></td> 26 <td>{%if package.recipe%}<a href="{% url "layer_versions_recipes" package.recipe.layer_version_id %}#{{package.recipe.name}}">{{package.recipe.name}}</a>{{package.package_name}}</a>{%endif%}</td>
27 27
28 <td>{{package.summary}}</td> 28 <td>{{package.summary}}</td>
29 <td>{{package.section}}</td> 29 <td>{{package.section}}</td>
@@ -32,8 +32,8 @@
32 <td>{{package.license}}</td> 32 <td>{{package.license}}</td>
33 <td> 33 <td>
34 <div style="height: 3em; overflow:auto"> 34 <div style="height: 3em; overflow:auto">
35 {% for bpd in package.bpackage_dependencies_package.all %} 35 {% for bpd in package.package_dependencies_source.all %}
36 {{bpd.dep_type}}: {{bpd.depends_on}} <br/> 36 {{bpd.dep_type}}: {{bpd.depends_on.name}} <br/>
37 {% endfor %} 37 {% endfor %}
38 </div> 38 </div>
39 </td> 39 </td>
diff --git a/bitbake/lib/toaster/bldviewer/templates/package.html b/bitbake/lib/toaster/bldviewer/templates/package.html
index c22e988e95..b1246e788a 100644
--- a/bitbake/lib/toaster/bldviewer/templates/package.html
+++ b/bitbake/lib/toaster/bldviewer/templates/package.html
@@ -23,7 +23,7 @@
23 <a href="{% url layer_versions_recipes package.recipe.layer_version_id %}#{{package.recipe.name}}">{{package.recipe.name}}</a>{{package.package_name}}</a>{%endif%}</td> 23 <a href="{% url layer_versions_recipes package.recipe.layer_version_id %}#{{package.recipe.name}}">{{package.recipe.name}}</a>{{package.package_name}}</a>{%endif%}</td>
24 <td> 24 <td>
25 <div style="height: 4em; overflow:auto"> 25 <div style="height: 4em; overflow:auto">
26 {% for d in package.tpackage_dependencies_package.all %} 26 {% for d in package.package_dependencies_source.all %}
27 <a href="#{{d.name}}">{{d.depends_on.name}}</a><br/> 27 <a href="#{{d.name}}">{{d.depends_on.name}}</a><br/>
28 {% endfor %} 28 {% endfor %}
29 </div> 29 </div>
diff --git a/bitbake/lib/toaster/bldviewer/views.py b/bitbake/lib/toaster/bldviewer/views.py
index 7be4d4b899..3eb785b6c6 100644
--- a/bitbake/lib/toaster/bldviewer/views.py
+++ b/bitbake/lib/toaster/bldviewer/views.py
@@ -20,8 +20,9 @@ import operator
20 20
21from django.db.models import Q 21from django.db.models import Q
22from django.shortcuts import render 22from django.shortcuts import render
23from orm.models import Build, Target, Task, Layer, Layer_Version, Recipe, Target_Package, LogMessage, Variable 23from orm.models import Build, Target, Task, Layer, Layer_Version, Recipe, LogMessage, Variable
24from orm.models import Task_Dependency, Recipe_Dependency, Build_Package, Build_File, Build_Package_Dependency 24from orm.models import Task_Dependency, Recipe_Dependency, Package, Package_File, Package_Dependency
25from orm.models import Target_Installed_Package
25from django.views.decorators.cache import cache_control 26from django.views.decorators.cache import cache_control
26 27
27@cache_control(no_store=True) 28@cache_control(no_store=True)
@@ -78,23 +79,20 @@ def configuration(request, build_id):
78 79
79def bpackage(request, build_id): 80def bpackage(request, build_id):
80 template = 'bpackage.html' 81 template = 'bpackage.html'
81 packages = Build_Package.objects.filter(build = build_id) 82 packages = Package.objects.filter(build = build_id)
82 context = {'build': Build.objects.filter(pk=build_id)[0], 'packages' : packages} 83 context = {'build': Build.objects.filter(pk=build_id)[0], 'packages' : packages}
83 return render(request, template, context) 84 return render(request, template, context)
84 85
85def bfile(request, build_id, package_id): 86def bfile(request, build_id, package_id):
86 template = 'bfile.html' 87 template = 'bfile.html'
87 files = Build_File.objects.filter(bpackage = package_id) 88 files = Package_File.objects.filter(package = package_id)
88 context = {'build': Build.objects.filter(pk=build_id)[0], 'files' : files} 89 context = {'build': Build.objects.filter(pk=build_id)[0], 'files' : files}
89 return render(request, template, context) 90 return render(request, template, context)
90 91
91def tpackage(request, build_id, target_id): 92def tpackage(request, build_id, target_id):
92 template = 'package.html' 93 template = 'package.html'
93 94 packages = map(lambda x: x.package, list(Target_Installed_Package.objects.filter(target=target_id)))
94 packages = Target_Package.objects.filter(target=target_id) 95 context = {'build': Build.objects.filter(pk=build_id)[0], 'packages' : packages}
95
96 context = {'build' : Build.objects.filter(pk=build_id)[0],'packages': packages}
97
98 return render(request, template, context) 96 return render(request, template, context)
99 97
100def layer(request): 98def layer(request):
@@ -135,17 +133,16 @@ def model_explorer(request, model_name):
135 model_mapping = { 133 model_mapping = {
136 'build': Build, 134 'build': Build,
137 'target': Target, 135 'target': Target,
138 'target_package': Target_Package,
139 'task': Task, 136 'task': Task,
140 'task_dependency': Task_Dependency, 137 'task_dependency': Task_Dependency,
141 'package': Build_Package, 138 'package': Package,
142 'layer': Layer, 139 'layer': Layer,
143 'layerversion': Layer_Version, 140 'layerversion': Layer_Version,
144 'recipe': Recipe, 141 'recipe': Recipe,
145 'recipe_dependency': Recipe_Dependency, 142 'recipe_dependency': Recipe_Dependency,
146 'build_package': Build_Package, 143 'package': Package,
147 'build_package_dependency': Build_Package_Dependency, 144 'package_dependency': Package_Dependency,
148 'build_file': Build_File, 145 'build_file': Package_File,
149 'variable': Variable, 146 'variable': Variable,
150 'logmessage': LogMessage, 147 'logmessage': LogMessage,
151 } 148 }