Webhob patches for DSI and Web modules
PATCH 86/94 bitbake: cooker: add the inherits attribute to the dependency tree
In reply to Alex DAMIANFrom: Alexandru DAMIAN <[email protected]>
The built dependency tree has to have the inherits attribute so that the UIs can use and save this information.
--- bitbake/lib/bb/cooker.py | 1 + 1 file changed, 1 insertion(+)
bitbake/lib/bb/cooker.py +1 -0
@@ -481,6 +481,7 @@ class BBCooker: depend_tree["pn"][pn] = {} depend_tree["pn"][pn]["filename"] = fn depend_tree["pn"][pn]["version"] = version + depend_tree["pn"][pn]["inherits"] = self.recipecache.inherits.get(fn, None) # if we have extra caches, list all attributes they bring in extra_info = []
Signature · 1 line
1.8.1.2
PATCH 87/94 bitbake: webhob: Clean up links in Simple UI
In reply to Alex DAMIANFrom: Alexandru DAMIAN <[email protected]>
This patch fixes 404s and 500 errors coming up on
a spidering of the UI simple interface.
Test used: wget -r -l 6 http://localhost:8000/
For log, look up build/whbmain.log file.
--- bitbake/lib/webhob/bldviewer/templates/build.html | 2 +- bitbake/lib/webhob/bldviewer/views.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-)
bitbake/lib/webhob/bldviewer/templates/build.html +1 -1
@@ -27,7 +27,7 @@ <td><a href="/simple/build/{{build.id}}/configuration/">{{build.get_outcome_display}}</a></td> <td>{{build.started_on}}</td> <td>{{build.completed_on}}</td> - <td>{% for t in build.target_set.all %}<a href="/simple/build/{{build.id}}/target/{{t.id}}">{{t.target}}</a><br/>{% endfor %}</td> + <td>{% for t in build.target_set.all %}<a href="/simple/build/{{build.id}}/target/{{t.id}}/packages/">{{t.target}}</a><br/>{% endfor %}</td> <td>{% if build.is_image %} <a href="/simple/build/{{build.id}}/package/">{{build.is_image}}</a>{% else %} {{build.is_image}} {% endif %}</td> <td>{{build.machine}}</td> <td>{% time_difference build.started_on build.completed_on %}</td>
bitbake/lib/webhob/bldviewer/views.py +0 -1
@@ -52,7 +52,6 @@ def tpackage(request, build_id, target_id): template = 'package.html' packages = Target_Package.objects.filter(target=target_id) - package_depends = Target_Package_Dependency.objects.filter(package__in=packages) context = {'build' : Build.objects.filter(pk=build_id)[0],'packages': packages}
Signature · 1 line
1.8.1.2
PATCH 88/94 bitbake: dsi: read correct recipe description field
In reply to Alex DAMIANFrom: Alexandru DAMIAN <[email protected]>
Fixing reading the recipe description field.
[YOCTO #5010]
--- bitbake/lib/bb/ui/buildinfohelper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
bitbake/lib/bb/ui/buildinfohelper.py +1 -1
@@ -568,7 +568,7 @@ class BuildInfoHelper(object): recipe_info['layer_version'] = layer_version_obj recipe_info['summary'] = event._depgraph['pn'][pn]['summary'] recipe_info['license'] = event._depgraph['pn'][pn]['license'] - recipe_info['description'] = event._depgraph['pn'][pn]['summary'] + recipe_info['description'] = event._depgraph['pn'][pn]['description'] recipe_info['section'] = event._depgraph['pn'][pn]['section'] recipe_info['licensing_info'] = 'Not Available' recipe_info['homepage'] = event._depgraph['pn'][pn]['homepage']
Signature · 1 line
1.8.1.2
PATCH 89/94 bitbake: cooker: send layer information with dependency tree
In reply to Alex DAMIANFrom: Alexandru DAMIAN <[email protected]>
Adding layer priorities information to the dependency tree. This is needed because the layer priorities are not computed until runtime, and priority information is needed for recording correct recipe information.
[YOCTO #5218]
--- bitbake/lib/bb/cooker.py | 1 + 1 file changed, 1 insertion(+)
bitbake/lib/bb/cooker.py +1 -0
@@ -470,6 +470,7 @@ class BBCooker: depend_tree["packages"] = {} depend_tree["rdepends-pkg"] = {} depend_tree["rrecs-pkg"] = {} + depend_tree["layer-priorities"] = self.recipecache.bbfile_config_priorities for task in xrange(len(rq.rqdata.runq_fnid)): taskname = rq.rqdata.runq_task[task]
Signature · 1 line
1.8.1.2
PATCH 90/94 bitbake: webhob: store and display layer priorities
In reply to Alex DAMIANFrom: Alexandru DAMIAN <[email protected]>
Recording layer version priorities based on the information sent with the dependency tree. The layer versions are already created, just need to update the layer priority info.
Modifying the Simple interface to display the layer priorities.
[YOCTO #5218]
--- bitbake/lib/bb/ui/buildinfohelper.py | 7 +++++++ bitbake/lib/webhob/bldviewer/templates/layer.html | 2 +- bitbake/lib/webhob/bldviewer/templates/recipe.html | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-)
bitbake/lib/bb/ui/buildinfohelper.py +7 -0
@@ -547,6 +547,13 @@ class BuildInfoHelper(object): def store_dependency_information(self, event): + # save layer version priorities + for lv in event._depgraph['layer-priorities']: + (name, path, regexp, priority) = lv + layer_version_obj = self._get_layer_version_for_path(path[1:]) # paths start with a ^ + assert layer_version_obj is not None + layer_version_obj.priority = priority + layer_version_obj.save() # save build time package information self.internal_state['bldpkgs'] = {}
bitbake/lib/webhob/bldviewer/templates/layer.html +1 -1
@@ -23,7 +23,7 @@ <td><table> {% for lv in layer.versions %} <tr><td> - <a href="/simple/layerversions/{{lv.id}}/recipes">{{lv.branch}}:{{lv.commit}} ({{lv.count}} recipes)</a> + <a href="/simple/layerversions/{{lv.id}}/recipes">({{lv.priority}}){{lv.branch}}:{{lv.commit}} ({{lv.count}} recipes)</a> </td></tr> {% endfor %} </table></td>
bitbake/lib/webhob/bldviewer/templates/recipe.html +1 -1
@@ -2,7 +2,7 @@ {% block pagename %} <ul class="nav nav-tabs" style="display: inline-block"> - <li><a>Layer {{layer_version.layer.name}} : {{layer_version.branch}} : {{layer_version.commit}}</a></li> + <li><a>Layer {{layer_version.layer.name}} : {{layer_version.branch}} : {{layer_version.commit}} : {{layer_version.priority}}</a></li> </ul> <h1>Toaster - Recipes for a Layer</h1> {% endblock %}
Signature · 1 line
1.8.1.2
PATCH 91/94 bitbake: webhob: collect recipe licensing info
In reply to Alex DAMIANFrom: Alexandru DAMIAN <[email protected]>
Collecting licensing info from log data.
The logs are generated in insane.bbclass.
Modified Simple interface to display licensing file.
[YOCTO #5194]
--- bitbake/lib/bb/ui/buildinfohelper.py | 7 +++++++ bitbake/lib/bb/ui/dsi.py | 2 +- bitbake/lib/webhob/bldviewer/templates/recipe.html | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-)
bitbake/lib/bb/ui/buildinfohelper.py +7 -0
@@ -654,6 +654,13 @@ class BuildInfoHelper(object): self.orm_wrapper.create_logmessage(log_information) def store_log_event(self, event): + # look up license files info from insane.bbclass + m = re.match("([^:]*): md5 checksum matched for ([^;]*)", event.msg) + if m: + (pn, fn) = m.groups() + self.internal_state['recipes'][pn].licensing_info = fn + self.internal_state['recipes'][pn].save() + if event.levelno < format.WARNING: return if not 'build' in self.internal_state:
bitbake/lib/bb/ui/dsi.py +1 -1
@@ -322,6 +322,7 @@ def main(server, eventHandler, params, tf = TerminalFilter): continue if isinstance(event, logging.LogRecord): + buildinfohelper.store_log_event(event) if event.levelno >= format.ERROR: errors = errors + 1 return_value = 1
@@ -333,7 +334,6 @@ def main(server, eventHandler, params, tf = TerminalFilter): if event.taskpid != 0 and event.levelno <= format.NOTE: continue - buildinfohelper.store_log_event(event) logger.handle(event) continue
bitbake/lib/webhob/bldviewer/templates/recipe.html +2 -0
@@ -18,6 +18,7 @@ <th>Description</th> <th>Section</th> <th>License</th> + <th>License file</th> <th>Homepage</th> <th>Bugtracker</th> <th>Author</th>
@@ -34,6 +35,7 @@ <td>{{recipe.description}}</td> <td>{{recipe.section}}</td> <td>{{recipe.license}}</td> + <td>{{recipe.licensing_info}}</td> <td>{{recipe.homepage}}</td> <td>{{recipe.bugtracker}}</td> <td>{{recipe.author}}</td>
Signature · 1 line
1.8.1.2
PATCH 92/94 bitbake: webhob: Simple UI interface CSS fix
In reply to Alex DAMIANFrom: Alexandru DAMIAN <[email protected]>
In the build packages page of the Simple interface, setting overflow:auto to be able to scroll the dependency information area.
[YOCTO #5196]
--- bitbake/lib/webhob/bldviewer/templates/bpackage.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
bitbake/lib/webhob/bldviewer/templates/bpackage.html +1 -1
@@ -31,7 +31,7 @@ <td>{{package.size}}</td> <td>{{package.license}}</td> <td> - <div style="height: 3em"> + <div style="height: 3em; overflow:auto"> {% for bpd in package.bpackage_dependencies_package.all %} {{bpd.dep_type}}: {{bpd.depends_on}} <br/> {% endfor %}
Signature · 1 line
1.8.1.2
PATCH 93/94 bitbake: dsi: fix typos
In reply to Alex DAMIANFrom: Alexandru DAMIAN <[email protected]>
Some copy-pasted code didn't get pasted right,
so we fix some of the typos which crepped out.
This fixes some bugs which aren't logged
in Bugzilla, which caused data transfer to fail
silently.
--- bitbake/lib/bb/ui/buildinfohelper.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
bitbake/lib/bb/ui/buildinfohelper.py +6 -6
@@ -178,27 +178,27 @@ class ORMWrapper(object): if not p.startswith("("): Build_Package_Dependency.objects.get_or_create( package = bp_object, depends_on = p, dep_type = Build_Package_Dependency.TYPE_RDEPENDS) - if package_info['RDEPENDS'] is not None: + if package_info['RPROVIDES'] is not None: for p in package_info['RPROVIDES'].split(" "): if not p.startswith("("): Build_Package_Dependency.objects.get_or_create( package = bp_object, depends_on = p, dep_type = Build_Package_Dependency.TYPE_RPROVIDES) - if package_info['RDEPENDS'] is not None: + if package_info['RRECOMMENDS'] is not None: for p in package_info['RRECOMMENDS'].split(" "): if not p.startswith("("): Build_Package_Dependency.objects.get_or_create( package = bp_object, depends_on = p, dep_type = Build_Package_Dependency.TYPE_RRECOMMENDS) - if package_info['RDEPENDS'] is not None: + if package_info['RSUGGESTS'] is not None: for p in package_info['RSUGGESTS'].split(" "): if not p.startswith("("): Build_Package_Dependency.objects.get_or_create( package = bp_object, depends_on = p, dep_type = Build_Package_Dependency.TYPE_RSUGGESTS) - if package_info['RDEPENDS'] is not None: + if package_info['RREPLACES'] is not None: for p in package_info['RREPLACES'].split(" "): if not p.startswith("("): Build_Package_Dependency.objects.get_or_create( package = bp_object, depends_on = p, dep_type = Build_Package_Dependency.TYPE_RREPLACES) - if package_info['RDEPENDS'] is not None: + if package_info['RCONFLICTS'] is not None: for p in package_info['RCONFLICTS'].split(" "): if not p.startswith("("): Build_Package_Dependency.objects.get_or_create( package = bp_object,
@@ -643,7 +643,7 @@ class BuildInfoHelper(object): if not 'package_files' in self.internal_state.keys(): self.internal_state['package_files'] = {} - data = event._data + data = event.data self.internal_state['package_files'][data['PKG']] = data['FILES'] def store_log_information(self, level, text):
Signature · 1 line
1.8.1.2
PATCH 94/94 bitbake: webhob: do not set timezones
In reply to Alex DAMIANFrom: Alexandru DAMIAN <[email protected]>
Preventing webhob setting a default timezone.
As such, it will always use the current time
for the local computer.
[YOCTO #5186]
--- bitbake/lib/webhob/whbmain/settings.py | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-)
bitbake/lib/webhob/whbmain/settings.py +15 -11
@@ -20,16 +20,6 @@ DATABASES = { } } -# If we're using sqlite, we need to tweak the performance a bit -from django.db.backends.signals import connection_created -def activate_synchronous_off(sender, connection, **kwargs): - if connection.vendor == 'sqlite': - cursor = connection.cursor() - cursor.execute('PRAGMA synchronous = 0;') -connection_created.connect(activate_synchronous_off) -# - - # Hosts/domain names that are valid for this site; required if DEBUG is False # See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts ALLOWED_HOSTS = []
@@ -38,7 +28,9 @@ ALLOWED_HOSTS = [] # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name # although not all choices may be available on all operating systems. # In a Windows environment this must be set to your system time zone. -TIME_ZONE = 'America/Chicago' + +# Always use local computer's time zone +TIME_ZONE = '' # Language code for this installation. All choices can be found here: # http://www.i18nguy.com/unicode/language-identifiers.html
@@ -54,6 +46,7 @@ USE_I18N = True # calendars according to the current locale. USE_L10N = True + # If you set this to False, Django will not use timezone-aware datetimes. USE_TZ = True
@@ -167,3 +160,14 @@ LOGGING = { }, } } + +# If we're using sqlite, we need to tweak the performance a bit +from django.db.backends.signals import connection_created +def activate_synchronous_off(sender, connection, **kwargs): + if connection.vendor == 'sqlite': + cursor = connection.cursor() + cursor.execute('PRAGMA synchronous = 0;') +connection_created.connect(activate_synchronous_off) +# + +
Signature · 1 line
1.8.1.2
Hi Alex,
Quoted 3 lines · On Tuesday 24 September 2013 17:52:50 Alex DAMIAN wrote:
From: Alexandru DAMIAN <[email protected]>
Patches for the DSI and Web modules of Webhob, in the order of development.
I hate to be a pain, but apart from the commits that change existing modules e.g. cooker, all of these commits need to be squashed into one commit that simply adds Web Hob to bitbake - we don't need the full incremental development history.
(Of course we do want to preserve the list of bug IDs / contributors from the commit messages, though.)
Thanks,
Paul
Signature · 2 lines
Paul Eggleton Intel Open Source Technology Centre