diff options
| -rw-r--r-- | bitbake/lib/toaster/toastergui/templates/configvars.html | 4 | ||||
| -rw-r--r-- | bitbake/lib/toaster/toastergui/templatetags/projecttags.py | 15 | ||||
| -rwxr-xr-x | bitbake/lib/toaster/toastergui/views.py | 6 |
3 files changed, 23 insertions, 2 deletions
diff --git a/bitbake/lib/toaster/toastergui/templates/configvars.html b/bitbake/lib/toaster/toastergui/templates/configvars.html index 1bd29aac0d..3e4c7e85ea 100644 --- a/bitbake/lib/toaster/toastergui/templates/configvars.html +++ b/bitbake/lib/toaster/toastergui/templates/configvars.html | |||
| @@ -55,7 +55,7 @@ | |||
| 55 | <td class="variable_value"><a data-toggle="modal" href="#variable-{{variable.pk}}">{{variable.variable_value|truncatechars:153}}</a></td> | 55 | <td class="variable_value"><a data-toggle="modal" href="#variable-{{variable.pk}}">{{variable.variable_value|truncatechars:153}}</a></td> |
| 56 | <td class="file"><a data-toggle="modal" href="#variable-{{variable.pk}}"> | 56 | <td class="file"><a data-toggle="modal" href="#variable-{{variable.pk}}"> |
| 57 | {% if variable.vhistory.all %} {% autoescape off %} | 57 | {% if variable.vhistory.all %} {% autoescape off %} |
| 58 | {{variable.vhistory.all | filter_setin_files:file_filter }} | 58 | {{variable.vhistory.all | filter_setin_files:file_filter | cut_layer_path_prefix:layer_names}} |
| 59 | {% endautoescape %} {% endif %} | 59 | {% endautoescape %} {% endif %} |
| 60 | </a></td> | 60 | </a></td> |
| 61 | <td class="description"> | 61 | <td class="description"> |
| @@ -115,7 +115,7 @@ | |||
| 115 | <tbody> | 115 | <tbody> |
| 116 | {% for vh in variable.vhistory.all %} | 116 | {% for vh in variable.vhistory.all %} |
| 117 | <tr> | 117 | <tr> |
| 118 | <td>{{forloop.counter}}</td><td>{{vh.file_name}}</td><td>{{vh.operation}}</td><td>{{vh.line_number}}</td> | 118 | <td>{{forloop.counter}}</td><td>{{vh.file_name|cut_layer_path_prefix:layer_names}}</td><td>{{vh.operation}}</td><td>{{vh.line_number}}</td> |
| 119 | </tr> | 119 | </tr> |
| 120 | {%endfor%} | 120 | {%endfor%} |
| 121 | </tbody> | 121 | </tbody> |
diff --git a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py index e66910cd9d..0ccf73a619 100644 --- a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py +++ b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py | |||
| @@ -307,3 +307,18 @@ def is_shaid(text): | |||
| 307 | return False | 307 | return False |
| 308 | except ValueError: | 308 | except ValueError: |
| 309 | return False | 309 | return False |
| 310 | |||
| 311 | @register.filter | ||
| 312 | def cut_layer_path_prefix(fullpath,layer_names): | ||
| 313 | ### if some part of the full local path to a layer matches | ||
| 314 | ### an entry in layer_names (sorted desc), return the layer | ||
| 315 | ### name relative path. | ||
| 316 | for lname in layer_names: | ||
| 317 | # import rpdb; rpdb.set_trace() | ||
| 318 | # only try layer names that are non-trivial to avoid false matches | ||
| 319 | if len(lname) >= 4: | ||
| 320 | # match layer name with as a subdir / or for remote layers /_ | ||
| 321 | if re.search('/' + lname, fullpath) or re.search('/_' + lname, fullpath): | ||
| 322 | parts = re.split(lname, fullpath, 1) | ||
| 323 | return lname + parts[1] | ||
| 324 | return fullpath | ||
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index ea47d96eea..9f35062925 100755 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py | |||
| @@ -1261,6 +1261,11 @@ def configvars(request, build_id): | |||
| 1261 | 1261 | ||
| 1262 | variables = _build_page_range(Paginator(queryset, pagesize), request.GET.get('page', 1)) | 1262 | variables = _build_page_range(Paginator(queryset, pagesize), request.GET.get('page', 1)) |
| 1263 | 1263 | ||
| 1264 | layers = Layer.objects.filter(layer_version_layer__projectlayer__project__build=build_id).order_by("-name") | ||
| 1265 | layer_names = map(lambda layer : layer.name, layers) | ||
| 1266 | # special case for meta built-in layer | ||
| 1267 | layer_names.append('meta') | ||
| 1268 | |||
| 1264 | # show all matching files (not just the last one) | 1269 | # show all matching files (not just the last one) |
| 1265 | file_filter= search_term + ":" | 1270 | file_filter= search_term + ":" |
| 1266 | if filter_string.find('/conf/') > 0: | 1271 | if filter_string.find('/conf/') > 0: |
| @@ -1283,6 +1288,7 @@ def configvars(request, build_id): | |||
| 1283 | 'total_count':queryset_with_search.count(), | 1288 | 'total_count':queryset_with_search.count(), |
| 1284 | 'default_orderby' : 'variable_name:+', | 1289 | 'default_orderby' : 'variable_name:+', |
| 1285 | 'search_term':search_term, | 1290 | 'search_term':search_term, |
| 1291 | 'layer_names' : layer_names, | ||
| 1286 | # Specifies the display of columns for the table, appearance in "Edit columns" box, toggling default show/hide, and specifying filters for columns | 1292 | # Specifies the display of columns for the table, appearance in "Edit columns" box, toggling default show/hide, and specifying filters for columns |
| 1287 | 'tablecols' : [ | 1293 | 'tablecols' : [ |
| 1288 | {'name': 'Variable', | 1294 | {'name': 'Variable', |
