diff options
author | Dave Lerner <dave.lerner@windriver.com> | 2014-03-24 16:37:17 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-03-28 13:44:52 +0000 |
commit | 14a84434a1c76f5d0bef7a75f2c7529a9ff166cf (patch) | |
tree | 1f00f4bb710398382d20aeaf56e701b328eb8765 | |
parent | c07a294e30e09926a07081ebc275c1766304ce38 (diff) | |
download | poky-14a84434a1c76f5d0bef7a75f2c7529a9ff166cf.tar.gz |
bitbake: toaster: show installed package name
[YOCTO #5922]
Implement changes that show the installed package name after the
official 'recipe-named' package name. If the alias exists and
is different than the package name, then the alias is shown as a
'muted' string after the package name in the form 'as some-alias-name'.
This formatting appears in the included package pages in the elements:
* local breadcrumbs at the top of package included pages,
* <h1> title headings along with a help bubble that is not hovering,
and
* package lists where the help bubble appears when the mouse hovers
over the row.
The changes in detail in this patch per file are:
views.py
- added function that tests whether the package object's installed_name
should be shown,
- added function that appends package name with version and revision to
encapsulate package name formatting in one place and referred to as
package.fullpackagespec,
- changed package_built* and package_included* functions to use both
of the above new formatting functions, passing the formatted values to
templates, and
- adhered to django coding styles by renaming module local
'get_package*' functions with "_" prefix.
package_detail_base.html
- added display of package aliases for included package page,
- refactored to use package.fullpackagespec, formatted by view function,
- added javascript function to format package alias with help, and
- removed trailing whitespace.
package_included_detail.html
- used javascript function above to format package alias, and
- refactored to use package.fullpackagespec.
package_included_dependencies.html
- used javascript function above to format package alias,
- refactored to use package.fullpackagespec,
- forced empty data cells following hover-help to draw borders
by appending space, and
- removed trailing whitespace.
package_included_reverse_dependencies.html
- use javascript function above to format package alias,
- refactor to use views fullpackagespe, and
- force empty data cells following hover-help to draw borders
by appending space.
package_built_detail.html
- refactored to use package.fullpackagespec, and
- removed trailing whitespace.
package_built_dependencies.html
- refactored to use package.fullpackagespec, and
- removed trailing whitespace.
projecttags.py
- removed unused filter to handle installed name
- removed extra spaces around "title = " in format_vpackage_namehelp
(Bitbake rev: c604e14df8cdb1f47535f093d7044955d4c2057d)
Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 files changed, 121 insertions, 65 deletions
diff --git a/bitbake/lib/toaster/toastergui/templates/package_built_dependencies.html b/bitbake/lib/toaster/toastergui/templates/package_built_dependencies.html index 4932f74c88..a2011d6fb6 100644 --- a/bitbake/lib/toaster/toastergui/templates/package_built_dependencies.html +++ b/bitbake/lib/toaster/toastergui/templates/package_built_dependencies.html | |||
@@ -2,7 +2,6 @@ | |||
2 | {% load projecttags %} | 2 | {% load projecttags %} |
3 | 3 | ||
4 | {% block tabcontent %} | 4 | {% block tabcontent %} |
5 | {% with fullPackageSpec=package.name|add:"-"|add:package.version|add:"-"|add:package.revision|filtered_packagespec %} | ||
6 | <ul class="nav nav-pills"> | 5 | <ul class="nav nav-pills"> |
7 | <li class=""> | 6 | <li class=""> |
8 | <a href="{% url 'package_built_detail' build.id package.id %}"> | 7 | <a href="{% url 'package_built_detail' build.id package.id %}"> |
@@ -21,11 +20,11 @@ | |||
21 | <div class="tab-pane active" id="dependencies"> | 20 | <div class="tab-pane active" id="dependencies"> |
22 | {% ifequal runtime_deps|length 0 %} | 21 | {% ifequal runtime_deps|length 0 %} |
23 | <div class="alert alert-info"> | 22 | <div class="alert alert-info"> |
24 | <strong>{{fullPackageSpec}}</strong> has no runtime dependencies. | 23 | <strong>{{package.fullpackagespec}}</strong> has no runtime dependencies. |
25 | </div> | 24 | </div> |
26 | {% else %} | 25 | {% else %} |
27 | <div class="alert alert-info"> | 26 | <div class="alert alert-info"> |
28 | <strong>{{fullPackageSpec}}</strong> is <strong>not included</strong> in any image. These are its projected runtime dependencies if you were to include it in future builds. | 27 | <strong>{{package.fullpackagespec}}</strong> is <strong>not included</strong> in any image. These are its projected runtime dependencies if you were to include it in future builds. |
29 | </div> | 28 | </div> |
30 | <table class="table table-bordered table-hover"> | 29 | <table class="table table-bordered table-hover"> |
31 | <thead> | 30 | <thead> |
@@ -56,7 +55,7 @@ | |||
56 | </tr> | 55 | </tr> |
57 | {% endifequal %} | 56 | {% endifequal %} |
58 | {% endfor %} | 57 | {% endfor %} |
59 | </tbody> | 58 | </tbody> |
60 | </table> | 59 | </table> |
61 | {% endifequal %} | 60 | {% endifequal %} |
62 | {% ifnotequal other_deps|length 0 %} | 61 | {% ifnotequal other_deps|length 0 %} |
@@ -72,7 +71,7 @@ | |||
72 | Relationship type | 71 | Relationship type |
73 | </th> | 72 | </th> |
74 | </tr> | 73 | </tr> |
75 | </thead> | 74 | </thead> |
76 | <tbody> | 75 | <tbody> |
77 | {% for other_dep in other_deps %} | 76 | {% for other_dep in other_deps %} |
78 | {% ifequal other_dep.version '' %} | 77 | {% ifequal other_dep.version '' %} |
@@ -106,5 +105,4 @@ | |||
106 | {% endifnotequal %} | 105 | {% endifnotequal %} |
107 | </div> <!-- tab-pane --> | 106 | </div> <!-- tab-pane --> |
108 | </div> <!-- tab-content --> | 107 | </div> <!-- tab-content --> |
109 | {% endwith %} | ||
110 | {% endblock tabcontent %} | 108 | {% endblock tabcontent %} |
diff --git a/bitbake/lib/toaster/toastergui/templates/package_built_detail.html b/bitbake/lib/toaster/toastergui/templates/package_built_detail.html index d8f0b75381..6ccd4056cb 100644 --- a/bitbake/lib/toaster/toastergui/templates/package_built_detail.html +++ b/bitbake/lib/toaster/toastergui/templates/package_built_detail.html | |||
@@ -2,7 +2,7 @@ | |||
2 | {% load projecttags %} | 2 | {% load projecttags %} |
3 | 3 | ||
4 | {% block tabcontent %} | 4 | {% block tabcontent %} |
5 | {% with fullPackageSpec=package.name|add:"-"|add:package.version|add:"-"|add:package.revision|filtered_packagespec packageFileCount=package.buildfilelist_package.count %} | 5 | {% with packageFileCount=package.buildfilelist_package.count %} |
6 | <!-- Generated Files --> | 6 | <!-- Generated Files --> |
7 | {% if package.buildtargetlist_package.count == 0 %} | 7 | {% if package.buildtargetlist_package.count == 0 %} |
8 | {# Not included case #} | 8 | {# Not included case #} |
@@ -21,7 +21,7 @@ | |||
21 | <!-- Package file list or if empty, alert pane --> | 21 | <!-- Package file list or if empty, alert pane --> |
22 | {% if packageFileCount > 0 %} | 22 | {% if packageFileCount > 0 %} |
23 | <div class="alert alert-info"> | 23 | <div class="alert alert-info"> |
24 | {{fullPackageSpec}} is <strong>not included</strong> in any image. These are the files that would be added to an image root file system if you were to include it in future builds. | 24 | {{package.fullpackagespec}} is <strong>not included</strong> in any image. These are the files that would be added to an image root file system if you were to include it in future builds. |
25 | </div> | 25 | </div> |
26 | <table class="table table-bordered table-hover"> | 26 | <table class="table table-bordered table-hover"> |
27 | <thead> | 27 | <thead> |
@@ -29,7 +29,7 @@ | |||
29 | <th>File</th> | 29 | <th>File</th> |
30 | <th>Size</th> | 30 | <th>Size</th> |
31 | </tr> | 31 | </tr> |
32 | </thead> | 32 | </thead> |
33 | <tbody> | 33 | <tbody> |
34 | {% for file in package.buildfilelist_package.all|dictsort:"path" %} | 34 | {% for file in package.buildfilelist_package.all|dictsort:"path" %} |
35 | <tr> | 35 | <tr> |
@@ -42,7 +42,7 @@ | |||
42 | 42 | ||
43 | {% else %} | 43 | {% else %} |
44 | <div class="alert alert-info"> | 44 | <div class="alert alert-info"> |
45 | <strong>{{fullPackageSpec}}</strong> does not generate any files. | 45 | <strong>{{package.fullpackagespec}}</strong> does not generate any files. |
46 | </div> | 46 | </div> |
47 | {% endif %} | 47 | {% endif %} |
48 | 48 | ||
diff --git a/bitbake/lib/toaster/toastergui/templates/package_detail_base.html b/bitbake/lib/toaster/toastergui/templates/package_detail_base.html index 6925aecb4d..5ec9dd79f4 100644 --- a/bitbake/lib/toaster/toastergui/templates/package_detail_base.html +++ b/bitbake/lib/toaster/toastergui/templates/package_detail_base.html | |||
@@ -1,24 +1,45 @@ | |||
1 | {% extends "basebuilddetailpage.html" %} | 1 | {% extends "basebuilddetailpage.html" %} |
2 | {% load projecttags %} | 2 | {% load projecttags %} |
3 | 3 | ||
4 | {% block extraheadcontent %} | ||
5 | <!-- functions to format package 'installed_package' alias --> | ||
6 | <script> | ||
7 | function fmtAliasHelp(package_name, alias, hover) { | ||
8 | var r = null; | ||
9 | if (alias != null && alias != '') { | ||
10 | r = '<span class="muted"> as ' + alias + ' '; | ||
11 | r += '<i class="icon-question-sign get-help'; | ||
12 | if (hover) { | ||
13 | r+= ' hover-help'; | ||
14 | } | ||
15 | else { | ||
16 | r+= ' heading-help'; | ||
17 | } | ||
18 | r += '"'; | ||
19 | title = package_name + ' was renamed at packaging time and was installed on your system as ' + alias; | ||
20 | r += ' title="' + title + '">'; | ||
21 | r += '</i>'; | ||
22 | r += '</span>'; | ||
23 | document.write(r); | ||
24 | } | ||
25 | } | ||
26 | </script> | ||
27 | {% endblock extraheadcontent %} | ||
4 | {% block localbreadcrumb %} | 28 | {% block localbreadcrumb %} |
5 | {% with fullPackageSpec=package.name|add:"_"|add:package.version|add:"-"|add:package.revision|filtered_packagespec %} | ||
6 | {% if target %} | 29 | {% if target %} |
7 | <li><a href="{% url "target" build.id target.id %}">{{target.target}}</a></li> | 30 | <li><a href="{% url "target" build.id target.id %}">{{target.target}}</a></li> |
31 | <li>{{package.fullpackagespec}} {% if package.alias %} as {{package.alias}}{% endif %}</li> | ||
8 | {% else %} | 32 | {% else %} |
9 | <li><a href="{% url "packages" build.id %}"> Packages </a></li> | 33 | <li><a href="{% url "packages" build.id %}"> Packages </a></li> |
34 | <li>{{package.fullpackagespec}}</li> | ||
10 | {% endif %} | 35 | {% endif %} |
11 | <li>{{fullPackageSpec}}</li> | ||
12 | {% endwith %} | ||
13 | {% endblock localbreadcrumb %} | 36 | {% endblock localbreadcrumb %} |
14 | 37 | ||
15 | {% block pagedetailinfomain %} | 38 | {% block pagedetailinfomain %} |
16 | {% with fullPackageSpec=package.name|add:"_"|add:package.version|add:"-"|add:package.revision|filtered_packagespec %} | ||
17 | |||
18 | <div class="row span11"> | 39 | <div class="row span11"> |
19 | <div class="page-header"> | 40 | <div class="page-header"> |
20 | {% block title %} | 41 | {% block title %} |
21 | <h1>{{fullPackageSpec}}</h1> | 42 | <h1>{{package.fullpackagespec}}</h1> |
22 | {% endblock title %} | 43 | {% endblock title %} |
23 | </div> <!-- page-header --> | 44 | </div> <!-- page-header --> |
24 | </div> <!-- row span11 page-header --> | 45 | </div> <!-- row span11 page-header --> |
@@ -93,7 +114,7 @@ | |||
93 | {{package.recipe.layer_version.layer.name}} | 114 | {{package.recipe.layer_version.layer.name}} |
94 | {% if package.recipe.layer_version.layer.name|format_none_and_zero != "" %} | 115 | {% if package.recipe.layer_version.layer.name|format_none_and_zero != "" %} |
95 | {% comment %} | 116 | {% comment %} |
96 | # Removed per team meeting of 1/29/2014 until | 117 | # Removed per team meeting of 1/29/2014 until |
97 | # decision on index search algorithm | 118 | # decision on index search algorithm |
98 | <a href="http://layers.openembedded.org" target="_blank"> | 119 | <a href="http://layers.openembedded.org" target="_blank"> |
99 | <i class="icon-share get-info"></i> | 120 | <i class="icon-share get-info"></i> |
@@ -121,5 +142,4 @@ | |||
121 | </dl> | 142 | </dl> |
122 | </div> <!-- row4 well --> | 143 | </div> <!-- row4 well --> |
123 | {% endblock twocolumns %} | 144 | {% endblock twocolumns %} |
124 | {% endwith %} | ||
125 | {% endblock pagedetailinfomain %} | 145 | {% endblock pagedetailinfomain %} |
diff --git a/bitbake/lib/toaster/toastergui/templates/package_included_dependencies.html b/bitbake/lib/toaster/toastergui/templates/package_included_dependencies.html index c76774ac9c..e06e073688 100644 --- a/bitbake/lib/toaster/toastergui/templates/package_included_dependencies.html +++ b/bitbake/lib/toaster/toastergui/templates/package_included_dependencies.html | |||
@@ -2,13 +2,15 @@ | |||
2 | {% load projecttags %} | 2 | {% load projecttags %} |
3 | 3 | ||
4 | {% block title %} | 4 | {% block title %} |
5 | {% with fullPackageSpec=package.name|add:"_"|add:package.version|add:"-"|add:package.revision|filtered_packagespec %} | 5 | <h1> |
6 | <h1>{{fullPackageSpec}} <small>({{target.target}})</small></h1> | 6 | {{package.fullpackagespec}} |
7 | {% endwith %} | 7 | <script> fmtAliasHelp("{{package.name}}", "{{package.alias}}", false) </script> |
8 | <small>({{target.target}})</small> | ||
9 | </h1> | ||
8 | {% endblock title %} | 10 | {% endblock title %} |
9 | 11 | ||
10 | {% block tabcontent %} | 12 | {% block tabcontent %} |
11 | {% with fullPackageSpec=package.name|add:"_"|add:package.version|add:"-"|add:package.revision|filtered_packagespec packageFileCount=package.buildfilelist_package.count %} | 13 | {% with packageFileCount=package.buildfilelist_package.count %} |
12 | {% include "package_included_tabs.html" with active_tab="dependencies" %} | 14 | {% include "package_included_tabs.html" with active_tab="dependencies" %} |
13 | <div class="tab-content"> | 15 | <div class="tab-content"> |
14 | <div class="tab-pane active" id="dependencies"> | 16 | <div class="tab-pane active" id="dependencies"> |
@@ -29,22 +31,22 @@ | |||
29 | <a href="{% url 'package_included_detail' build.id target.id runtime_dep.depends_on_id %}"> | 31 | <a href="{% url 'package_included_detail' build.id target.id runtime_dep.depends_on_id %}"> |
30 | {{runtime_dep.name}} | 32 | {{runtime_dep.name}} |
31 | </a> | 33 | </a> |
34 | <script>fmtAliasHelp("{{runtime_dep.name}}", "{{runtime_dep.alias}}", true)</script> | ||
32 | </td> | 35 | </td> |
33 | {% else %} | 36 | {% else %} |
34 | <td> | 37 | <td> |
35 | {{runtime_dep.name|format_vpackage_namehelp}} | 38 | {{runtime_dep.name|format_vpackage_namehelp}} |
36 | </td> | 39 | </td> |
37 | {% endif %} | 40 | {% endif %} |
38 | 41 | <td>{{runtime_dep.version}} </td> | |
39 | <td>{{runtime_dep.version}}</td> | 42 | <td>{{runtime_dep.size|filtered_filesizeformat}} </td> |
40 | <td>{{runtime_dep.size|filtered_filesizeformat}}</td> | ||
41 | </tr> | 43 | </tr> |
42 | {% endfor %} | 44 | {% endfor %} |
43 | </tbody> | 45 | </tbody> |
44 | </table> | 46 | </table> |
45 | {% else %} | 47 | {% else %} |
46 | <div class="alert alert-info"> | 48 | <div class="alert alert-info"> |
47 | <strong>{{fullPackageSpec}}</strong> has no runtime dependencies. | 49 | <strong>{{package.fullpackagespec}}</strong> has no runtime dependencies. |
48 | </div> | 50 | </div> |
49 | {% endifnotequal %} | 51 | {% endifnotequal %} |
50 | 52 | ||
@@ -61,7 +63,7 @@ | |||
61 | Relationship type | 63 | Relationship type |
62 | </th> | 64 | </th> |
63 | </tr> | 65 | </tr> |
64 | </thead> | 66 | </thead> |
65 | <tbody> | 67 | <tbody> |
66 | {% for other_dep in other_deps %} | 68 | {% for other_dep in other_deps %} |
67 | {% if other_dep.installed %} | 69 | {% if other_dep.installed %} |
@@ -70,6 +72,9 @@ | |||
70 | <td> | 72 | <td> |
71 | <a href="{% url 'package_included_detail' build.id target.id other_dep.depends_on_id %}"> | 73 | <a href="{% url 'package_included_detail' build.id target.id other_dep.depends_on_id %}"> |
72 | {{other_dep.name}} | 74 | {{other_dep.name}} |
75 | <script> | ||
76 | fmtAliasHelp("{{other_dep.name}}","{{other_dep.alias}}", true) | ||
77 | </script> | ||
73 | </a> | 78 | </a> |
74 | </td> | 79 | </td> |
75 | {% else %} | 80 | {% else %} |
@@ -77,8 +82,8 @@ | |||
77 | {{other_dep.name|format_vpackage_namehelp}} | 82 | {{other_dep.name|format_vpackage_namehelp}} |
78 | </td> | 83 | </td> |
79 | {% endif %} | 84 | {% endif %} |
80 | <td>{{other_dep.version}}</td> | 85 | <td>{{other_dep.version}} </td> |
81 | <td>{{other_dep.size|filtered_filesizeformat}}</td> | 86 | <td>{{other_dep.size|filtered_filesizeformat}} </td> |
82 | <td> | 87 | <td> |
83 | {{other_dep.dep_type_display}} | 88 | {{other_dep.dep_type_display}} |
84 | <i class="icon-question-sign get-help hover-help" title="{{other_dep.dep_type_help}}" ></i> | 89 | <i class="icon-question-sign get-help hover-help" title="{{other_dep.dep_type_help}}" ></i> |
@@ -96,7 +101,7 @@ | |||
96 | </tr> | 101 | </tr> |
97 | {% endif %} | 102 | {% endif %} |
98 | {% endfor %} | 103 | {% endfor %} |
99 | </tbody> | 104 | </tbody> |
100 | </table> | 105 | </table> |
101 | {% endifnotequal %} | 106 | {% endifnotequal %} |
102 | </div> <!-- end tab-pane --> | 107 | </div> <!-- end tab-pane --> |
diff --git a/bitbake/lib/toaster/toastergui/templates/package_included_detail.html b/bitbake/lib/toaster/toastergui/templates/package_included_detail.html index ce4f1cb33c..e89ebdf58c 100644 --- a/bitbake/lib/toaster/toastergui/templates/package_included_detail.html +++ b/bitbake/lib/toaster/toastergui/templates/package_included_detail.html | |||
@@ -2,13 +2,17 @@ | |||
2 | {% load projecttags %} | 2 | {% load projecttags %} |
3 | 3 | ||
4 | {% block title %} | 4 | {% block title %} |
5 | {% with fullPackageSpec=package.name|add:"_"|add:package.version|add:"-"|add:package.revision|filtered_packagespec %} | 5 | <h1> |
6 | <h1>{{fullPackageSpec}} <small>({{target.target}})</small></h1> | 6 | {{package.fullpackagespec}} |
7 | {% endwith %} | 7 | <script> |
8 | fmtAliasHelp("{{package.name}}", "{{package.alias}}", false) | ||
9 | </script> | ||
10 | <small>({{target.target}})</small> | ||
11 | </h1> | ||
8 | {% endblock title %} | 12 | {% endblock title %} |
9 | 13 | ||
10 | {% block tabcontent %} | 14 | {% block tabcontent %} |
11 | {% with fullPackageSpec=package.name|add:"_"|add:package.version|add:"-"|add:package.revision|filtered_packagespec packageFileCount=package.buildfilelist_package.count %} | 15 | {% with packageFileCount=package.buildfilelist_package.count %} |
12 | {% include "package_included_tabs.html" with active_tab="detail" %} | 16 | {% include "package_included_tabs.html" with active_tab="detail" %} |
13 | <div class="tab-content"> | 17 | <div class="tab-content"> |
14 | <div class="tab-pane active" id="files"> | 18 | <div class="tab-pane active" id="files"> |
@@ -36,7 +40,7 @@ | |||
36 | 40 | ||
37 | {% else %} | 41 | {% else %} |
38 | <div class="alert alert-info"> | 42 | <div class="alert alert-info"> |
39 | <strong>{{fullPackageSpec}}</strong> does not generate any files. | 43 | <strong>{{package.fullpackagespec}}</strong> does not generate any files. |
40 | </div> | 44 | </div> |
41 | {% endif %} | 45 | {% endif %} |
42 | </div> <!-- end tab-pane --> | 46 | </div> <!-- end tab-pane --> |
diff --git a/bitbake/lib/toaster/toastergui/templates/package_included_reverse_dependencies.html b/bitbake/lib/toaster/toastergui/templates/package_included_reverse_dependencies.html index 8653ae0fe2..1efcb1a610 100644 --- a/bitbake/lib/toaster/toastergui/templates/package_included_reverse_dependencies.html +++ b/bitbake/lib/toaster/toastergui/templates/package_included_reverse_dependencies.html | |||
@@ -2,20 +2,22 @@ | |||
2 | {% load projecttags %} | 2 | {% load projecttags %} |
3 | 3 | ||
4 | {% block title %} | 4 | {% block title %} |
5 | {% with fullPackageSpec=package.name|add:"_"|add:package.version|add:"-"|add:package.revision|filtered_packagespec %} | 5 | <h1> |
6 | <h1>{{fullPackageSpec}} <small>({{target.target}})</small></h1> | 6 | {{package.fullpackagespec}} |
7 | {% endwith %} | 7 | <script> fmtAliasHelp("{{package.name}}", "{{package.alias}}", false) </script> |
8 | <small>({{target.target}})</small> | ||
9 | </h1> | ||
8 | {% endblock title %} | 10 | {% endblock title %} |
9 | 11 | ||
10 | {% block tabcontent %} | 12 | {% block tabcontent %} |
11 | {% with fullPackageSpec=package.name|add:"_"|add:package.version|add:"-"|add:package.revision|filtered_packagespec packageFileCount=package.buildfilelist_package.count %} | 13 | {% with packageFileCount=package.buildfilelist_package.count %} |
12 | {% include "package_included_tabs.html" with active_tab="reverse" %} | 14 | {% include "package_included_tabs.html" with active_tab="reverse" %} |
13 | <div class="tab-content"> | 15 | <div class="tab-content"> |
14 | <div class="tab-pane active" id="brought-in-by"> | 16 | <div class="tab-pane active" id="brought-in-by"> |
15 | 17 | ||
16 | {% ifequal reverse_deps|length 0 %} | 18 | {% ifequal reverse_deps|length 0 %} |
17 | <div class="alert alert-info"> | 19 | <div class="alert alert-info"> |
18 | <strong>{{fullPackageSpec}}</strong> has no reverse runtime dependencies. | 20 | <strong>{{package.fullpackagespec}}</strong> has no reverse runtime dependencies. |
19 | </div> | 21 | </div> |
20 | {% else %} | 22 | {% else %} |
21 | <table class="table table-bordered table-hover"> | 23 | <table class="table table-bordered table-hover"> |
@@ -34,6 +36,7 @@ | |||
34 | <a href="{% url 'package_included_detail' build.id target.id reverse_dep.dependent_id %}"> | 36 | <a href="{% url 'package_included_detail' build.id target.id reverse_dep.dependent_id %}"> |
35 | {{reverse_dep.name}} | 37 | {{reverse_dep.name}} |
36 | </a> | 38 | </a> |
39 | <script>fmtAliasHelp("{{reverse_dep.name}}", "{{reverse_dep.alias}}", true)</script> | ||
37 | </td> | 40 | </td> |
38 | {% else %} | 41 | {% else %} |
39 | <td> | 42 | <td> |
@@ -41,8 +44,8 @@ | |||
41 | </td> | 44 | </td> |
42 | {% endif %} | 45 | {% endif %} |
43 | 46 | ||
44 | <td>{{reverse_dep.version}}</td> | 47 | <td>{{reverse_dep.version}} </td> |
45 | <td>{{reverse_dep.size|filtered_filesizeformat}}</td> | 48 | <td>{{reverse_dep.size|filtered_filesizeformat}} </td> |
46 | </tr> | 49 | </tr> |
47 | {% endfor %} | 50 | {% endfor %} |
48 | </tbody> | 51 | </tbody> |
diff --git a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py index 34c3c21d20..76166ca945 100644 --- a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py +++ b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py | |||
@@ -208,14 +208,6 @@ def filtered_installedsize(size, installed_size): | |||
208 | return size if (installed_size == 0) or (installed_size == "") or (installed_size == None) else installed_size | 208 | return size if (installed_size == 0) or (installed_size == "") or (installed_size == None) else installed_size |
209 | 209 | ||
210 | @register.filter | 210 | @register.filter |
211 | def filtered_installedname(name, installed_name): | ||
212 | """If package.installed_name not null and not empty | ||
213 | return <div class=muted> as {{package.installed_name}} | ||
214 | otherwise "" | ||
215 | """ | ||
216 | return name if (name == installed_name) or (not installed_name) or (installed_name == "") else name + " as " + installed_name | ||
217 | |||
218 | @register.filter | ||
219 | def filtered_packageversion(version, revision): | 211 | def filtered_packageversion(version, revision): |
220 | """ Emit "version-revision" if version and revision are not null | 212 | """ Emit "version-revision" if version and revision are not null |
221 | else "version" if version is not null | 213 | else "version" if version is not null |
@@ -245,6 +237,6 @@ def format_vpackage_rowclass(size): | |||
245 | def format_vpackage_namehelp(name): | 237 | def format_vpackage_namehelp(name): |
246 | r = name + ' ' | 238 | r = name + ' ' |
247 | r += '<i class="icon-question-sign get-help hover-help"' | 239 | r += '<i class="icon-question-sign get-help hover-help"' |
248 | r += ' title = "' + name + ' only has dependency information available.">' | 240 | r += ' title="' + name + ' only has dependency information available.">' |
249 | r += '</i>' | 241 | r += '</i>' |
250 | return mark_safe(r) | 242 | return mark_safe(r) |
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index 8f6e201ec2..0f92caf56b 100644 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py | |||
@@ -1280,7 +1280,7 @@ the RRECOMENDS or TRECOMENDS value. | |||
1280 | The lists are built in the sort order specified for the package runtime | 1280 | The lists are built in the sort order specified for the package runtime |
1281 | dependency views. | 1281 | dependency views. |
1282 | """ | 1282 | """ |
1283 | def get_package_dependencies(package_id, target_id = INVALID_KEY): | 1283 | def _get_package_dependencies(package_id, target_id = INVALID_KEY): |
1284 | runtime_deps = [] | 1284 | runtime_deps = [] |
1285 | other_deps = [] | 1285 | other_deps = [] |
1286 | other_depends_types = OTHER_DEPENDS_BASE | 1286 | other_depends_types = OTHER_DEPENDS_BASE |
@@ -1318,6 +1318,10 @@ def get_package_dependencies(package_id, target_id = INVALID_KEY): | |||
1318 | 'depends_on_id' : dep_package.id, | 1318 | 'depends_on_id' : dep_package.id, |
1319 | 'installed' : installed, | 1319 | 'installed' : installed, |
1320 | } | 1320 | } |
1321 | |||
1322 | if target_id != INVALID_KEY: | ||
1323 | dep['alias'] = _get_package_alias(dep_package) | ||
1324 | |||
1321 | if idep.dep_type == rdepends_type : | 1325 | if idep.dep_type == rdepends_type : |
1322 | runtime_deps.append(dep) | 1326 | runtime_deps.append(dep) |
1323 | elif idep.dep_type in other_depends_types : | 1327 | elif idep.dep_type in other_depends_types : |
@@ -1331,28 +1335,50 @@ def get_package_dependencies(package_id, target_id = INVALID_KEY): | |||
1331 | return retvalues | 1335 | return retvalues |
1332 | 1336 | ||
1333 | # Return the count of packages dependent on package for this target_id image | 1337 | # Return the count of packages dependent on package for this target_id image |
1334 | def get_package_reverse_dep_count(package, target_id): | 1338 | def _get_package_reverse_dep_count(package, target_id): |
1335 | return package.package_dependencies_target.filter(target_id__exact=target_id, dep_type__exact = Package_Dependency.TYPE_TRDEPENDS).count() | 1339 | return package.package_dependencies_target.filter(target_id__exact=target_id, dep_type__exact = Package_Dependency.TYPE_TRDEPENDS).count() |
1336 | 1340 | ||
1337 | # Return the count of the packages that this package_id is dependent on. | 1341 | # Return the count of the packages that this package_id is dependent on. |
1338 | # Use one of the two RDEPENDS types, either TRDEPENDS if the package was | 1342 | # Use one of the two RDEPENDS types, either TRDEPENDS if the package was |
1339 | # installed, or else RDEPENDS if only built. | 1343 | # installed, or else RDEPENDS if only built. |
1340 | def get_package_dependency_count(package, target_id, is_installed): | 1344 | def _get_package_dependency_count(package, target_id, is_installed): |
1341 | if is_installed : | 1345 | if is_installed : |
1342 | return package.package_dependencies_source.filter(target_id__exact = target_id, | 1346 | return package.package_dependencies_source.filter(target_id__exact = target_id, |
1343 | dep_type__exact = Package_Dependency.TYPE_TRDEPENDS).count() | 1347 | dep_type__exact = Package_Dependency.TYPE_TRDEPENDS).count() |
1344 | else : | 1348 | else : |
1345 | return package.package_dependencies_source.filter(dep_type__exact = Package_Dependency.TYPE_RDEPENDS).count() | 1349 | return package.package_dependencies_source.filter(dep_type__exact = Package_Dependency.TYPE_RDEPENDS).count() |
1346 | 1350 | ||
1351 | def _get_package_alias(package): | ||
1352 | alias = package.installed_name | ||
1353 | if alias != None and alias != '' and alias != package.name: | ||
1354 | return alias | ||
1355 | else: | ||
1356 | return '' | ||
1357 | |||
1358 | def _get_fullpackagespec(package): | ||
1359 | r = package.name | ||
1360 | version_good = package.version != None and package.version != '' | ||
1361 | revision_good = package.revision != None and package.revision != '' | ||
1362 | if version_good or revision_good: | ||
1363 | r += '_' | ||
1364 | if version_good: | ||
1365 | r += package.version | ||
1366 | if revision_good: | ||
1367 | r += '-' | ||
1368 | if revision_good: | ||
1369 | r += package.revision | ||
1370 | return r | ||
1371 | |||
1347 | def package_built_detail(request, build_id, package_id): | 1372 | def package_built_detail(request, build_id, package_id): |
1348 | template = "package_built_detail.html" | 1373 | template = "package_built_detail.html" |
1349 | if Build.objects.filter(pk=build_id).count() == 0 : | 1374 | if Build.objects.filter(pk=build_id).count() == 0 : |
1350 | return redirect(builds) | 1375 | return redirect(builds) |
1351 | package = Package.objects.filter(pk=package_id)[0] | 1376 | package = Package.objects.filter(pk=package_id)[0] |
1377 | package.fullpackagespec = _get_fullpackagespec(package) | ||
1352 | context = { | 1378 | context = { |
1353 | 'build' : Build.objects.filter(pk=build_id)[0], | 1379 | 'build' : Build.objects.filter(pk=build_id)[0], |
1354 | 'package' : package, | 1380 | 'package' : package, |
1355 | 'dependency_count' : get_package_dependency_count(package, -1, False), | 1381 | 'dependency_count' : _get_package_dependency_count(package, -1, False), |
1356 | } | 1382 | } |
1357 | return render(request, template, context) | 1383 | return render(request, template, context) |
1358 | 1384 | ||
@@ -1362,13 +1388,14 @@ def package_built_dependencies(request, build_id, package_id): | |||
1362 | return redirect(builds) | 1388 | return redirect(builds) |
1363 | 1389 | ||
1364 | package = Package.objects.filter(pk=package_id)[0] | 1390 | package = Package.objects.filter(pk=package_id)[0] |
1365 | dependencies = get_package_dependencies(package_id) | 1391 | package.fullpackagespec = _get_fullpackagespec(package) |
1392 | dependencies = _get_package_dependencies(package_id) | ||
1366 | context = { | 1393 | context = { |
1367 | 'build' : Build.objects.filter(pk=build_id)[0], | 1394 | 'build' : Build.objects.filter(pk=build_id)[0], |
1368 | 'package' : package, | 1395 | 'package' : package, |
1369 | 'runtime_deps' : dependencies['runtime_deps'], | 1396 | 'runtime_deps' : dependencies['runtime_deps'], |
1370 | 'other_deps' : dependencies['other_deps'], | 1397 | 'other_deps' : dependencies['other_deps'], |
1371 | 'dependency_count' : get_package_dependency_count(package, -1, False) | 1398 | 'dependency_count' : _get_package_dependency_count(package, -1, False) |
1372 | } | 1399 | } |
1373 | return render(request, template, context) | 1400 | return render(request, template, context) |
1374 | 1401 | ||
@@ -1379,13 +1406,15 @@ def package_included_detail(request, build_id, target_id, package_id): | |||
1379 | return redirect(builds) | 1406 | return redirect(builds) |
1380 | 1407 | ||
1381 | package = Package.objects.filter(pk=package_id)[0] | 1408 | package = Package.objects.filter(pk=package_id)[0] |
1409 | package.fullpackagespec = _get_fullpackagespec(package) | ||
1410 | package.alias = _get_package_alias(package) | ||
1382 | target = Target.objects.filter(pk=target_id)[0] | 1411 | target = Target.objects.filter(pk=target_id)[0] |
1383 | context = { | 1412 | context = { |
1384 | 'build' : Build.objects.filter(pk=build_id)[0], | 1413 | 'build' : Build.objects.filter(pk=build_id)[0], |
1385 | 'target' : target, | 1414 | 'target' : target, |
1386 | 'package' : package, | 1415 | 'package' : package, |
1387 | 'reverse_count' : get_package_reverse_dep_count(package, target_id), | 1416 | 'reverse_count' : _get_package_reverse_dep_count(package, target_id), |
1388 | 'dependency_count' : get_package_dependency_count(package, target_id, True) | 1417 | 'dependency_count' : _get_package_dependency_count(package, target_id, True) |
1389 | } | 1418 | } |
1390 | return render(request, template, context) | 1419 | return render(request, template, context) |
1391 | 1420 | ||
@@ -1395,17 +1424,19 @@ def package_included_dependencies(request, build_id, target_id, package_id): | |||
1395 | return redirect(builds) | 1424 | return redirect(builds) |
1396 | 1425 | ||
1397 | package = Package.objects.filter(pk=package_id)[0] | 1426 | package = Package.objects.filter(pk=package_id)[0] |
1427 | package.fullpackagespec = _get_fullpackagespec(package) | ||
1428 | package.alias = _get_package_alias(package) | ||
1398 | target = Target.objects.filter(pk=target_id)[0] | 1429 | target = Target.objects.filter(pk=target_id)[0] |
1399 | 1430 | ||
1400 | dependencies = get_package_dependencies(package_id, target_id) | 1431 | dependencies = _get_package_dependencies(package_id, target_id) |
1401 | context = { | 1432 | context = { |
1402 | 'build' : Build.objects.filter(pk=build_id)[0], | 1433 | 'build' : Build.objects.filter(pk=build_id)[0], |
1403 | 'package' : package, | 1434 | 'package' : package, |
1404 | 'target' : target, | 1435 | 'target' : target, |
1405 | 'runtime_deps' : dependencies['runtime_deps'], | 1436 | 'runtime_deps' : dependencies['runtime_deps'], |
1406 | 'other_deps' : dependencies['other_deps'], | 1437 | 'other_deps' : dependencies['other_deps'], |
1407 | 'reverse_count' : get_package_reverse_dep_count(package, target_id), | 1438 | 'reverse_count' : _get_package_reverse_dep_count(package, target_id), |
1408 | 'dependency_count' : get_package_dependency_count(package, target_id, True) | 1439 | 'dependency_count' : _get_package_dependency_count(package, target_id, True) |
1409 | } | 1440 | } |
1410 | return render(request, template, context) | 1441 | return render(request, template, context) |
1411 | 1442 | ||
@@ -1415,6 +1446,8 @@ def package_included_reverse_dependencies(request, build_id, target_id, package_ | |||
1415 | return redirect(builds) | 1446 | return redirect(builds) |
1416 | 1447 | ||
1417 | package = Package.objects.filter(pk=package_id)[0] | 1448 | package = Package.objects.filter(pk=package_id)[0] |
1449 | package.fullpackagespec = _get_fullpackagespec(package) | ||
1450 | package.alias = _get_package_alias(package) | ||
1418 | target = Target.objects.filter(pk=target_id)[0] | 1451 | target = Target.objects.filter(pk=target_id)[0] |
1419 | 1452 | ||
1420 | reverse_deps = [] | 1453 | reverse_deps = [] |
@@ -1426,6 +1459,7 @@ def package_included_reverse_dependencies(request, build_id, target_id, package_ | |||
1426 | version += '-' + dep_package.revision | 1459 | version += '-' + dep_package.revision |
1427 | dep = { | 1460 | dep = { |
1428 | 'name' : dep_package.name, | 1461 | 'name' : dep_package.name, |
1462 | 'alias' : _get_package_alias(dep_package), | ||
1429 | 'dependent_id' : dep_package.id, | 1463 | 'dependent_id' : dep_package.id, |
1430 | 'version' : version, | 1464 | 'version' : version, |
1431 | 'size' : dep_package.size | 1465 | 'size' : dep_package.size |
@@ -1438,8 +1472,8 @@ def package_included_reverse_dependencies(request, build_id, target_id, package_ | |||
1438 | 'package' : package, | 1472 | 'package' : package, |
1439 | 'target' : target, | 1473 | 'target' : target, |
1440 | 'reverse_deps' : reverse_deps, | 1474 | 'reverse_deps' : reverse_deps, |
1441 | 'reverse_count' : get_package_reverse_dep_count(package, target_id), | 1475 | 'reverse_count' : _get_package_reverse_dep_count(package, target_id), |
1442 | 'dependency_count' : get_package_dependency_count(package, target_id, True) | 1476 | 'dependency_count' : _get_package_dependency_count(package, target_id, True) |
1443 | } | 1477 | } |
1444 | return render(request, template, context) | 1478 | return render(request, template, context) |
1445 | 1479 | ||