bitbake: toaster: remove MANAGED references

We conflate the managed and analysis modes by
deleting alternative code paths, favouring the MANAGED mode,
always considering the MANAGED variable True.

(Bitbake rev: 0ac02d3775106b485e29496b62f31e91fd3f9387)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Alexandru DAMIAN
2015-06-09 16:03:36 +01:00
committed by Richard Purdie
parent b98a2fcab6
commit c362e61ee2
10 changed files with 8 additions and 149 deletions

View File

@@ -288,9 +288,7 @@ class BuildArtifact(models.Model):
def is_available(self):
if settings.MANAGED and build.project is not None:
return build.buildrequest.environment.has_artifact(file_path)
return False
return build.buildrequest.environment.has_artifact(file_path)
class ProjectTarget(models.Model):
project = models.ForeignKey(Project)

View File

@@ -48,7 +48,6 @@
};
</script>
<script src="{% static 'js/base.js' %}"></script>
{%if MANAGED %}
<script>
$(document).ready(function () {
/* Vars needed for base.js */
@@ -59,10 +58,6 @@
basePageInit(ctx);
});
</script>
{% endif %}
<script>
</script>
{% block extraheadcontent %}
{% endblock %}
@@ -80,14 +75,13 @@
<span class="brand">
<a href="/">Toaster</a>
{% if DEBUG %}
<i class="icon-info-sign" title="<strong>Toaster version information</strong>" data-content="<dl><dt>Branch</dt><dd>{{TOASTER_BRANCH}}</dd><dt>Revision</dt><dd>{{TOASTER_REVISION}}</dd><dt>Mode</dt><dd>{%if MANAGED%}Build{%else%}Analysis{%endif%}</dd></dl>"></i>
<i class="icon-info-sign" title="<strong>Toaster version information</strong>" data-content="<dl><dt>Branch</dt><dd>{{TOASTER_BRANCH}}</dd><dt>Revision</dt><dd>{{TOASTER_REVISION}}</dd></dl>"></i>
{% endif %}
</span>
<a class="pull-right manual" target="_blank" href="http://www.yoctoproject.org/docs/latest/toaster-manual/toaster-manual.html">
<i class="icon-book"></i>
Toaster manual
</a>
{%if MANAGED %}
<div class="btn-group pull-right">
<a class="btn" id="new-project-button" href="{% url 'newproject' %}">New project</a>
</div>
@@ -132,7 +126,6 @@
</ul>
</div>
{%endif%}
</div>
</div>

View File

@@ -7,10 +7,8 @@
<div class="section">
<ul class="breadcrumb" id="breadcrumb">
<li><a href="{% url 'all-builds' %}">All builds</a></li>
{% if MANAGED and build.project %}
<li><a href="{% url 'project' build.project.id %}">{{build.project.name}}</a></li>
{%endif%}
<li><a href="{%url 'builddashboard' build.pk%}">{{build.target_set.all.0.target}} {%if build.target_set.all.count > 1%}(+ {{build.target_set.all.count|add:"-1"}}){%endif%}{%if not MANAGED %}{{build.machine}}{%endif%} ({{build.completed_on|date:"d/m/y H:i"}})</a></li>
<li><a href="{%url 'builddashboard' build.pk%}">{{build.target_set.all.0.target}} {%if build.target_set.all.count > 1%}(+ {{build.target_set.all.count|add:"-1"}}){%endif%} ({{build.completed_on|date:"d/m/y H:i"}})</a></li>
{% block localbreadcrumb %}{% endblock %}
</ul>
<script>

View File

@@ -8,14 +8,12 @@
<!-- Breadcrumbs -->
<div class="section">
<ul class="breadcrumb" id="breadcrumb">
<li><a href="{% url 'all-builds' %}">All builds</a></li>
{% if MANAGED and build.project %}
<li><a href="{% url 'all-builds' %}">All builds</a></li>
<li><a href="{% url 'project' build.project.id %}">{{build.project.name}}</a></li>
{%endif%}
<li>
{% block parentbreadcrumb %}
<a href="{%url 'builddashboard' build.pk%}">
{{build.get_sorted_target_list.0.target}} {%if build.target_set.all.count > 1%}(+ {{build.target_set.all.count|add:"-1"}}){%endif%} {%if not MANAGED %}{{build.machine}}{% endif %} ({{build.completed_on|date:"d/m/y H:i"}})
{{build.get_sorted_target_list.0.target}} {%if build.target_set.all.count > 1%}(+ {{build.target_set.all.count|add:"-1"}}){%endif%} ({{build.completed_on|date:"d/m/y H:i"}})
</a>
{% endblock %}
</li>

View File

@@ -1,7 +1,6 @@
{% extends "basetable_top.html" %}
{%block custombuttons %}
{% if MANAGED %}
<div class="btn-group builds-projects">
<button class="btn dropdown-toggle" data-toggle="dropdown">
<span class="selection">Show all builds</span>
@@ -12,5 +11,4 @@
<li><a href="{% url 'all-projects'%}">Show all projects</a></li>
</ul>
</div>
{% endif %}
{%endblock%}

View File

@@ -1,7 +1,6 @@
{% extends "basetable_top.html" %}
{%block custombuttons %}
{% if MANAGED %}
<div class="btn-group builds-projects">
<button class="btn dropdown-toggle" data-toggle="dropdown">
<span class="selection">Show all projects</span>
@@ -12,5 +11,4 @@
<li><a href="{% url 'all-projects'%}">Show all projects</a></li>
</ul>
</div>
{% endif %}
{%endblock%}

View File

@@ -88,9 +88,6 @@
</a>
</td>
<!-- Layer directory -->
{% if not MANAGED or not build.project %}
<td class="recipe__layer_version__local_path">{{package.recipe.layer_version.local_path}}</td>
{% endif %}
{%else%}
<td class="recipe__name"></td>
<td class="recipe__version"></td>

View File

@@ -68,11 +68,9 @@
{% query build.task_build outcome=4 order__gt=0 as exectask%}
{% if exectask.count == 1 %}
<a href="{% url "task" build.id exectask.0.id %}">{{exectask.0.recipe.name}}.{{exectask.0.task_name}}</a>
{% if MANAGED and build.project %}
<a href="{% url 'build_artifact' build.id "tasklogfile" exectask.0.id %}">
<i class="icon-download-alt" title="" data-original-title="Download task log file"></i>
</a>
{% endif %}
{% elif exectask.count > 1%}
<a href="{% url "tasks" build.id %}?filter=outcome%3A4">{{exectask.count}} task{{exectask.count|pluralize}}</a>
{%endif%}
@@ -84,21 +82,15 @@
</td>
<td class="warnings_no">{% if build.warnings_no %}<a class="warnings_no warning" href="{% url "builddashboard" build.id %}#warnings">{{build.warnings_no}} warning{{build.warnings_no|pluralize}}</a>{%endif%}</td>
<td class="time"><a href="{% url "buildtime" build.id %}">{{build.timespent|sectohms}}</a></td>
{% if not MANAGED or not build.project %}
<td class="log">{{build.cooker_log_path}}</td>
{% endif %}
<td class="output">
{% if build.outcome == build.SUCCEEDED %}
<a href="{%url "builddashboard" build.id%}#images">{{fstypes|get_dict_value:build.id}}</a>
{% endif %}
</td>
{% if MANAGED %}
<td class="project">
{% if build.project %}
<a href="{% url 'project' build.project.id %}">{{build.project.name}}</a>
{% endif %}
</td>
{% endif %}
</tr>
{% endfor %}

View File

@@ -37,9 +37,7 @@
<span > <i class="icon-warning-sign yellow"></i><strong><a href="#warnings" class="warning show-warnings"> {{build.warnings_no}} warning{{build.warnings_no|pluralize}}</a></strong></span>
{% endif %}
<span class="pull-right">Build time: <a href="{% url 'buildtime' build.pk %}">{{ build.timespent|sectohms }}</a>
{% if MANAGED and build.project %}
<a class="btn {%if build.outcome == build.SUCCEEDED%}btn-success{%else%}btn-danger{%endif%} pull-right log" href="{% url 'build_artifact' build.id "cookerlog" build.id %}">Download build log</a>
{% endif %}
</span>
{%endif%}
</div>
@@ -117,19 +115,11 @@
<dt>
<i class="icon-question-sign get-help" title="The location in disk of the license manifest, a document listing all packages installed in your image and their licenses"></i>
{% if MANAGED and build.project %}
License manifest
{% else %}
<a href="{% url 'targetpkg' build.pk target.target.pk %}">License manifest</a>
{% endif %}
</dt>
{% if MANAGED and build.project %}
<dd>
<a href="{% url 'targetpkg' build.pk target.target.pk %}">View in Toaster</a> |
<a href="{% url 'build_artifact' build.pk 'licensemanifest' target.target.pk %}">Download</a></dd>
{% else %}
<dd><code>{{target.target.license_manifest_path}}</code></dd>
{% endif %}
<dt>
<i class="icon-question-sign get-help" title="Image files are stored in <code>/build/tmp/deploy/images/</code>"></i>
Image files
@@ -170,13 +160,9 @@
Other artifacts</dt>
<dd><div>
{% for ba in build.buildartifact_set.all|dictsort:"file_name" %}
{% if MANAGED and build.project %}
<a href="{%url 'build_artifact' build.id 'buildartifact' ba.id %}">
{% endif %}
{{ba.get_local_file_name}}
{% if MANAGED and build.project %}
</a>
{% endif %}
({{ba.file_size|filtered_filesizeformat}}) <br/>
{% endfor %}
@@ -211,11 +197,9 @@
<span class="task-name">{{exectask.0.task_name}}</span>
</a>
{% if MANAGED and build.project %}
<a href="{% url 'build_artifact' build.id "tasklogfile" exectask.0.id %}">
<i class="icon-download-alt" title="" data-original-title="Download task log file"></i>
</a>
{% endif %}
{% elif exectask.count > 1%}
<a class="error" href="{% url "tasks" build.id %}?filter=outcome%3A4">{{exectask.count}}</a>

View File

@@ -807,18 +807,6 @@ eans multiple licenses exist that cover different parts of the source',
]
}
if not toastermain.settings.MANAGED or build.project is None:
tc_layerDir = {
'name':'Layer directory',
'qhelp':'Location in disk of the layer providing the recipe that builds the package',
'orderfield' : _get_toggle_order( request, "recipe__layer_version__local_path" ),
'ordericon' : _get_toggle_order_icon( request, "recipe__layer_version__local_path" ),
'orderkey' : "recipe__layer_version__local_path",
'clclass' : 'layer_directory',
'hidden' : 1,
}
context['tablecols'].append(tc_layerDir)
response = render(request, template, context)
_set_parameters_values(pagesize, orderby, request)
@@ -1209,9 +1197,6 @@ def tasks_common(request, build_id, variant, task_anchor):
]}
if not toastermain.settings.MANAGED or build.project is None:
context['tablecols'].append(tc_log)
response = render(request, template, context)
_set_parameters_values(pagesize, orderby, request)
return response
@@ -1336,18 +1321,6 @@ def recipes(request, build_id):
]
}
if not toastermain.settings.MANAGED or build.project is None:
context['tablecols'].append(
{
'name':'Layer directory',
'qhelp':'Path to the layer prodiving the recipe',
'orderfield': _get_toggle_order(request, "layer_version__local_path"),
'ordericon':_get_toggle_order_icon(request, "layer_version__local_path"),
'orderkey' : 'layer_version__local_path',
'clclass': 'layer_version__local_path', 'hidden': 1,
})
response = render(request, template, context)
_set_parameters_values(pagesize, orderby, request)
return response
@@ -1550,18 +1523,6 @@ def bpackage(request, build_id):
]
}
if not toastermain.settings.MANAGED or build.project is None:
tc_layerDir = {
'name':'Layer directory',
'qhelp':'Path to the layer providing the recipe that builds the package',
'orderfield': _get_toggle_order(request, "recipe__layer_version__local_path"),
'ordericon':_get_toggle_order_icon(request, "recipe__layer_version__local_path"),
'orderkey' : 'recipe__layer_version__local_path',
'clclass': 'recipe__layer_version__local_path', 'hidden': 1,
}
context['tablecols'].append(tc_layerDir)
response = render(request, template, context)
_set_parameters_values(pagesize, orderby, request)
return response
@@ -1877,7 +1838,6 @@ def managedcontextprocessor(request):
import subprocess
ret = {
"projects": Project.objects.all(),
"MANAGED" : toastermain.settings.MANAGED,
"DEBUG" : toastermain.settings.DEBUG,
"TOASTER_BRANCH": toastermain.settings.TOASTER_BRANCH,
"TOASTER_REVISION" : toastermain.settings.TOASTER_REVISION,
@@ -1892,8 +1852,8 @@ from orm.models import Project, ProjectLayer, ProjectTarget, ProjectVariable
# we have a set of functions if we're in managed mode, or
# a default "page not available" simple functions for interactive mode
if toastermain.settings.MANAGED:
if True:
from django.contrib.auth.models import User
from django.contrib.auth import authenticate, login
from django.contrib.auth.decorators import login_required
@@ -2937,11 +2897,8 @@ if toastermain.settings.MANAGED:
return context
else:
# shows the "all builds" page for interactive mode; this is the old code, simply moved
@_template_renderer('build.html')
def builds(request):
@_template_renderer('builds.html')
def builds_old(request):
# define here what parameters the view needs in the GET portion in order to
# be able to display something. 'count' and 'page' are mandatory for all views
# that use paginators.
@@ -3132,57 +3089,3 @@ else:
_set_parameters_values(pagesize, orderby, request)
return context
@_template_renderer('landing_not_managed.html')
def newproject(request):
return {}
@_template_renderer('landing_not_managed.html')
def project(request, pid):
return {}
from django.views.decorators.csrf import csrf_exempt
@csrf_exempt
@_template_renderer('landing_not_managed.html')
def xhr_datatypeahead(request, pid):
return {}
@_template_renderer('landing_not_managed.html')
def xhr_configvaredit(request, pid):
return {}
@_template_renderer('landing_not_managed.html')
def importlayer(request):
return {}
@_template_renderer('landing_not_managed.html')
def projectconf(request, pid):
return {}
@_template_renderer('landing_not_managed.html')
def projectbuilds(request, pid):
return {}
@_template_renderer('landing_not_managed.html')
def build_artifact(request, build_id, artifact_type, artifact_id):
return {}
@_template_renderer('landing_not_managed.html')
def projects(request):
return {}
@_template_renderer('landing_not_managed.html')
def xhr_importlayer(request):
return {}
@_template_renderer('landing_not_managed.html')
def xhr_updatelayer(request):
return {}
@_template_renderer('landing_not_managed.html')
def buildrequestdetails(request, pid, brid):
return {}