Patchwork [bitbake-devel,9/9] toaster: add URI search path list

login
register
mail settings
Submitter Alexandru DAMIAN
Date April 9, 2014, 1:17 p.m.
Message ID <50625fd85f0165642d26b75bf1b7263221ec96f2.1397049329.git.alexandru.damian@intel.com>
Download mbox | patch
Permalink /patch/70379/
State New
Headers show

Comments

Alexandru DAMIAN - April 9, 2014, 1:17 p.m.
From: David Reyna <David.Reyna@windriver.com>

Display the URI paths from SSTATE_DIR and SSTATE_MIRRORS
in the Task page.

[YOCTO #5996]

Signed-off-by: David Reyna <David.Reyna@windriver.com>
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
---
 lib/toaster/toastergui/templates/task.html |  2 +-
 lib/toaster/toastergui/views.py            | 12 ++++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

Patch

diff --git a/lib/toaster/toastergui/templates/task.html b/lib/toaster/toastergui/templates/task.html
index 66a6695..4555999 100644
--- a/lib/toaster/toastergui/templates/task.html
+++ b/lib/toaster/toastergui/templates/task.html
@@ -172,7 +172,7 @@ 
                 <i class="icon-question-sign get-help" title="The locations searched for the above file (i.e. your <code>sstate-cache</code> directory and any mirrors you have set up)"></i>
                 URI(s) searched
             </dt>
-            <dd><code>{{task.work_directory}}</code></dd>
+            <dd><ul>{% for uri in uri_list %}<li><code>{{uri}}</code></li>{% endfor %}</ul></dd>
         </dl>
     {% endif %}
     {% if task.sstate_result == task.SSTATE_MISS %}
diff --git a/lib/toaster/toastergui/views.py b/lib/toaster/toastergui/views.py
index 36eb0bf..e4ada14 100644
--- a/lib/toaster/toastergui/views.py
+++ b/lib/toaster/toastergui/views.py
@@ -481,6 +481,17 @@  def task( request, build_id, task_id ):
     if task.outcome == task.OUTCOME_FAILED:
         pass
 
+    uri_list= [ ]
+    variables = Variable.objects.filter(build=build_id)
+    v=variables.filter(variable_name='SSTATE_DIR')
+    if v.count > 0:
+        uri_list.append(v[0].variable_value)
+    v=variables.filter(variable_name='SSTATE_MIRRORS')
+    if (v.count > 0):
+        for mirror in v[0].variable_value.split('\\n'):
+            s=re.sub('.* ','',mirror.strip(' \t\n\r'))
+            if len(s): uri_list.append(s)
+
     context = {
             'build'           : Build.objects.filter( pk = build_id )[ 0 ],
             'object'          : task,
@@ -491,6 +502,7 @@  def task( request, build_id, task_id ):
             'log_head'        : log_head,
             'log_body'        : log_body,
             'showing_matches' : False,
+			'uri_list'        : uri_list,
     }
     if request.GET.get( 'show_matches', "" ):
         context[ 'showing_matches' ] = True