Patchwork [bitbake-devel,91/94] bitbake: webhob: collect recipe licensing info

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

Comments

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

Collecting licensing info from log data.
The logs are generated in insane.bbclass.

Modified Simple interface to display licensing file.

[YOCTO #5194]

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
---
 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(-)

Patch

diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py
index c8820a5..a3a50a3 100644
--- a/bitbake/lib/bb/ui/buildinfohelper.py
+++ b/bitbake/lib/bb/ui/buildinfohelper.py
@@ -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:
diff --git a/bitbake/lib/bb/ui/dsi.py b/bitbake/lib/bb/ui/dsi.py
index 22cff5d..434a6dd 100644
--- a/bitbake/lib/bb/ui/dsi.py
+++ b/bitbake/lib/bb/ui/dsi.py
@@ -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
 
diff --git a/bitbake/lib/webhob/bldviewer/templates/recipe.html b/bitbake/lib/webhob/bldviewer/templates/recipe.html
index ec8a46d..a624370 100644
--- a/bitbake/lib/webhob/bldviewer/templates/recipe.html
+++ b/bitbake/lib/webhob/bldviewer/templates/recipe.html
@@ -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>