Toaster patches
cover Toaster patches
Latest patches for bitbake reviewed on toaster mailing list:
Belen Barros Pena (7):
toaster: tasks Remove recipe version from defaults
toaster: configuration Provide machine help text
toaster: layer details Layout fixes
toaster: import layer Layout fixes
toaster: layer details Fix "edit" form interaction
toaster: Allow forward slash in variable names
toaster: orm Update IMAGE_FSTYPES values
David Reyna (1):
toaster: keep layer name in variable history path
Ed Bartosh (3):
toaster: don't kill toaster on start
toaster: remove handling of .toasterui.pid
toaster: don't kill all runserver processes
bin/toaster | 15 --------------- lib/bb/ui/buildinfohelper.py | 3 ++- lib/toaster/orm/models.py | 7 ++++--- lib/toaster/toastergui/buildtables.py | 3 ++- lib/toaster/toastergui/static/css/default.css | 10 +++++++++- lib/toaster/toastergui/static/js/layerdetails.js | 8 ++++---- lib/toaster/toastergui/templates/importlayer.html | 12 +++++++----- lib/toaster/toastergui/templates/layerdetails.html | 7 +++---- lib/toaster/toastergui/templates/project.html | 5 +---- lib/toaster/toastergui/templates/projectconf.html | 6 +++--- 10 files changed, 35 insertions(+), 41 deletions(-)
Signature · 1 line
2.7.4
PATCH 1/11 toaster: tasks Remove recipe version from defaults
From: Belen Barros Pena <[email protected]>
The 'Recipe version' column should not be part of the set of columns shown by default in the tasks table. Set the hidden property for that column to 'True' so that it doesn't show when you load that table for the first time.
[YOCTO #10179]
--- lib/toaster/toastergui/buildtables.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
lib/toaster/toastergui/buildtables.py +2 -1
@@ -482,7 +482,8 @@ class BuildTasksTable(BuildTablesMixin): orderable=True) self.add_column(title="Recipe version", - field_name='recipe__version') + field_name='recipe__version', + hidden=True) self.add_column(title="Executed", static_data_name="task_executed",
Signature · 1 line
2.7.4
PATCH 2/11 toaster: configuration Provide machine help text
In reply to Michael WoodFrom: Belen Barros Pena <[email protected]>
When you change the machine from the project configuration page, you get some useful suggestions as you start typing a machine name. However, the suggestions only include machines provided by the layers added to your project. This is not necessarily clear from the design (yes, it should be improved), which means you might be looking for a machine, not see it in the suggestions, and assume the machine is not supported by OpenEmbedded.
Since we are in no position to change the design of this page right now, add some explanatory help text to address the situation.
[YOCTO #8034]
--- lib/toaster/toastergui/templates/project.html | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
lib/toaster/toastergui/templates/project.html +1 -4
@@ -57,10 +57,7 @@ <p class="lead"><span id="project-machine-name"></span> <span class="glyphicon glyphicon-edit" id="change-machine-toggle"></span></p> <form id="select-machine-form" style="display:none;" class="form-inline"> - <div class="alert alert-info"> - <strong>Machine changes have a big impact on build outcome.</strong> You cannot really compare the builds for the new machine with the previous ones. - </div> - + <span class="help-block">Machine suggestions come from the list of layers added to your project. If you don't see the machine you are looking for, <a href="{% url 'projectmachines' project.id %}">check the full list of machines</a></span> <div class="form-group"> <input class="form-control" id="machine-change-input" autocomplete="off" value="" data-provide="typeahead" data-minlength="1" data-autocomplete="off" type="text"> </div>
Signature · 1 line
2.7.4
PATCH 3/11 toaster: layer details Layout fixes
In reply to Michael WoodFrom: Belen Barros Pena <[email protected]>
The layout of the layer details page was looking a bit awkward. This commit tidies things up.
--- lib/toaster/toastergui/static/css/default.css | 8 +++++++- lib/toaster/toastergui/templates/layerdetails.html | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-)
lib/toaster/toastergui/static/css/default.css +7 -1
@@ -161,7 +161,13 @@ dd .glyphicon-edit { margin-left: 5px; } /* Style the forms and definition lists in the layer details pages */ #change-repo-form .form-control { width: 17em; } +#information { margin-bottom: 5em; } #information dd > form { margin-bottom: 5px; margin-top: 5px; } +#edit-layer-source-form fieldset { margin-top: 20px; } +#directory-info, +#git-repo-info { margin-top: 20px; } +#layer-dir-path-in-details { width: 55%; } +.add-deps .form-control { width: 15em; } /* Style the forms and definition lists in the BitBake variables page */ .variable-list { margin-bottom: 20px; }
@@ -196,7 +202,7 @@ h2 { margin-bottom: 25px; } .tt-suggestion:active { background-color: #f5f5f5; cursor: pointer; } /* Style the import layer form controls*/ -legend { border: none; margin-top: 20px; } +legend { border: none; } .radioLegend { margin-bottom: 0; } #layer-name-ctrl { margin-top: 20px; } #import-layer-name,
lib/toaster/toastergui/templates/layerdetails.html +1 -1
@@ -258,7 +258,7 @@ <span class="glyphicon glyphicon-question-sign get-help" title="Other layers this layer depends upon"></span> </h3> - <ul class="list-unstyled current-value" id="layer-deps-list"> + <ul class="list-unstyled current-value lead" id="layer-deps-list"> {% for ld in layerversion.dependencies.all %} <li data-layer-id="{{ld.depends_on.id}}"> <a data-toggle="tooltip" title="{{ld.depends_on.layer.vcs_url}} | {{ld.depends_on.get_vcs_reference}}" href="{% url 'layerdetails' project.id ld.depends_on.id %}">{{ld.depends_on.layer.name}}</a>
Signature · 1 line
2.7.4
PATCH 4/11 toaster: import layer Layout fixes
In reply to Michael WoodFrom: Belen Barros Pena <[email protected]>
The layout of the import layer form was looking a bit awkward. This commit tidies things up a bit.
--- lib/toaster/toastergui/static/css/default.css | 1 + lib/toaster/toastergui/templates/importlayer.html | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-)
lib/toaster/toastergui/static/css/default.css +1 -0
@@ -203,6 +203,7 @@ h2 { margin-bottom: 25px; } /* Style the import layer form controls*/ legend { border: none; } +fieldset.fields-apart-from-layer-name { margin-top: 20px; } .radioLegend { margin-bottom: 0; } #layer-name-ctrl { margin-top: 20px; } #import-layer-name,
lib/toaster/toastergui/templates/importlayer.html +7 -5
@@ -113,16 +113,18 @@ <span class="glyphicon glyphicon-question-sign get-help" title="You can provide a Git branch, a tag or a commit SHA as the revision"></span> </label> <input type="text" class="form-control" id="layer-git-ref" required> - <span class="help-inline" style="diaply:none;" id="invalid-layer-revision-hint"></span> + <span class="help-inline" style="display:none;" id="invalid-layer-revision-hint"></span> </div> </fieldset> <fieldset class="fields-apart-from-layer-name" id="local-dir" style="display:none;"> <legend>Layer directory information</legend> - <label for="local-dir-path" class="control-label">Enter the absolute path to the layer directory</label> - <input type="text" class="form-control" id="local-dir-path" required/> - <p class="help-block" id="hintError-dir-path-starts-with-slash" style="display:none;">The absolute path must start with "/".</p> - <p class="help-block" id="hintError-dir-path" style="display:none;">The directory path cannot include spaces or any of these characters: . \ ? % * : | " " < ></p> + <div class="form-group"> + <label for="local-dir-path" class="control-label">Enter the absolute path to the layer directory</label> + <input type="text" class="form-control" id="local-dir-path" required/> + <p class="help-block" id="hintError-dir-path-starts-with-slash" style="display:none;">The absolute path must start with "/".</p> + <p class="help-block" id="hintError-dir-path" style="display:none;">The directory path cannot include spaces or any of these characters: . \ ? % * : | " " < ></p> + </div> </fieldset> <fieldset class="fields-apart-from-layer-name">
Signature · 1 line
2.7.4
PATCH 5/11 toaster: layer details Fix "edit" form interaction
In reply to Michael WoodFrom: Belen Barros Pena <[email protected]>
Make sure the layer information disappears when the edit form shows, and that the layer details come back when you click the 'cancel' button in the edit form.
--- lib/toaster/toastergui/static/js/layerdetails.js | 8 ++++---- lib/toaster/toastergui/templates/layerdetails.html | 5 ++--- 2 files changed, 6 insertions(+), 7 deletions(-)
lib/toaster/toastergui/static/js/layerdetails.js +4 -4
@@ -423,7 +423,7 @@ function layerDetailsPageInit (ctx) { $(this).hide(); saveSourceChangesBtn.attr("disabled", "disabled"); - $("#git-repo-info", "#directory-info").hide(); + $("#git-repo-info, #directory-info").hide(); $("#edit-layer-source-form").fadeIn(); if ($("#layer-dir-path-in-details").val() == "") { //Local dir path is empty...
@@ -473,9 +473,9 @@ function layerDetailsPageInit (ctx) { }); $('#cancel-changes-for-switch').click(function() { - $("#edit-layer-source-form").add("#layer-git").add("#layer-dir").fadeOut().promise().done(function(){ - editLayerSource.show(); - }); + $("#edit-layer-source-form").hide(); + $("#directory-info, #git-repo-info").fadeIn(); + editLayerSource.show(); }); saveSourceChangesBtn.click(function() {
lib/toaster/toastergui/templates/layerdetails.html +2 -3
@@ -130,8 +130,8 @@ <!-- layer details pane --> <div id="information" class="tab-pane active"> - {% if layerversion.layer.local_source_dir %} <h3>Layer source code location</h3> + {% if layerversion.layer.local_source_dir %} <dl class="dl-horizontal" id="directory-info"> <dt> Path to the layer directory
@@ -200,8 +200,7 @@ <input type="radio" name="source-location" id="repo" value="repo"> In a <strong>Git repository</strong> </label> - <p class="help-block" style="margin-left:20px;width:70%;">To build the layer Toaster must be able to access the Git repository, otherwise builds will fail. Toaster will\ - fetch and checkout your chosen Git revision every time you start a build.</p> + <p class="help-block" style="margin-left:20px;width:70%;">To build the layer Toaster must be able to access the Git repository, otherwise builds will fail. Toaster will fetch and checkout your chosen Git revision every time you start a build.</p> </div> <div class="radio" style="margin-top:15px;"> <label>
Signature · 1 line
2.7.4
PATCH 6/11 toaster: Allow forward slash in variable names
In reply to Michael WoodFrom: Belen Barros Pena <[email protected]>
Add forward slash to the list of special characters allowed in variable names. Also update the list of allowed special characters in the error messages.
[YOCTO #9611]
--- lib/toaster/toastergui/static/css/default.css | 1 + lib/toaster/toastergui/templates/projectconf.html | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-)
lib/toaster/toastergui/static/css/default.css +1 -0
@@ -182,6 +182,7 @@ dd.variable-list form { margin-top: 10px; } .scrolling.has-error { border-color: #a94442; } .help-block.text-danger { color: #a94442; } .tooltip-inner code { color: #fff; } +.text-danger > code { color: #a94442; } dd.variable-list .glyphicon-question-sign { font-size: 14px; } dd.variable-list .glyphicon-edit { font-size: 16px; } dt .glyphicon-trash { margin-left: 5px; font-size: 16px; }
lib/toaster/toastergui/templates/projectconf.html +3 -3
@@ -251,16 +251,16 @@ function validate_new_variable() { } } - var bad_chars = /[^a-zA-Z0-9\-_]/.test(variable); + var bad_chars = /[^a-zA-Z0-9\-_/]/.test(variable); var has_spaces = (0 <= variable.indexOf(" ")); var only_spaces = (0 < variable.length) && (0 == variable.trim().length); if (only_spaces) { error_msg = "A valid variable name cannot include spaces"; } else if (bad_chars && has_spaces) { - error_msg = "A valid variable name can only include letters, numbers, underscores, dashes, and cannot include spaces"; + error_msg = "A valid variable name can only include letters, numbers and the special characters <code> _ - /</code>. Variable names cannot include spaces"; } else if (bad_chars) { - error_msg = "A valid variable name can only include letters, numbers, underscores, and dashes"; + error_msg = "A valid variable name can only include letters, numbers and the special characters <code>_ - /</code>"; } if ("" != error_msg) {
Signature · 1 line
2.7.4
PATCH 7/11 toaster: keep layer name in variable history path
In reply to Michael WoodFrom: David Reyna <[email protected]>
When converting variable history file names to relative paths, keep the layer directory's name so that the user can distinguish between conf files with the same name.
[YOCTO #8188]
--- lib/bb/ui/buildinfohelper.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
lib/bb/ui/buildinfohelper.py +2 -1
@@ -1127,7 +1127,8 @@ class BuildInfoHelper(object): abs_file_name = vh['file'] for pp in path_prefixes: if abs_file_name.startswith(pp + "/"): - vh['file']=abs_file_name[len(pp + "/"):] + # preserve layer name in relative path + vh['file']=abs_file_name[pp.rfind("/")+1:] break # save the variables
Signature · 1 line
2.7.4
PATCH 8/11 toaster: orm Update IMAGE_FSTYPES values
In reply to Michael WoodFrom: Belen Barros Pena <[email protected]>
This patch fixes a typo in one of the IMAGE_FSTYPES values listed in Toaster. It also updates the hardcoded list of values to match the latest list in meta/classes/image_types.bbclass
[YOCTO #9447]
--- lib/toaster/orm/models.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
lib/toaster/orm/models.py +4 -3
@@ -876,9 +876,10 @@ class Target_Image_File(models.Model): SUFFIXES = { 'btrfs', 'cpio', 'cpio.gz', 'cpio.lz4', 'cpio.lzma', 'cpio.xz', 'cramfs', 'elf', 'ext2', 'ext2.bz2', 'ext2.gz', 'ext2.lzma', 'ext4', - 'ext4.gz', 'ext3', 'ext3.gz', 'hddimg', 'iso', 'jffs2', 'jffs2.sum', - 'squashfs', 'squashfs-lzo', 'squashfs-xz', 'tar.bz2', 'tar.lz4', - 'tar.xz', 'tartar.gz', 'ubi', 'ubifs', 'vmdk' + 'ext4.gz', 'ext3', 'ext3.gz', 'hdddirect', 'hddimg', 'iso', 'jffs2', + 'jffs2.sum', 'multiubi', 'qcow2', 'squashfs', 'squashfs-lzo', + 'squashfs-xz', 'tar', 'tar.bz2', 'tar.gz', 'tar.lz4', 'tar.xz', 'ubi', + 'ubifs', 'vdi', 'vmdk', 'wic', 'wic.bz2', 'wic.gz', 'wic.lzma' } target = models.ForeignKey(Target)
Signature · 1 line
2.7.4
PATCH 9/11 toaster: don't kill toaster on start
In reply to Michael WoodFrom: Ed Bartosh <[email protected]>
There is no point of trying to kill django development server when toaster starts because 'manage.py checksocket' command is already used in the script code to check if development server port is occupied.
Even if Toaster is listening on another port, killing previous instance looks quite implicit and doesn't solve anything as there are other processes that might be still running.
--- bin/toaster | 8 -------- 1 file changed, 8 deletions(-)
bin/toaster +0 -8
@@ -249,14 +249,6 @@ case $CMD in fi fi - # kill Toaster web server if it's alive - if [ -e $BUILDDIR/.toastermain.pid ] && kill -0 `cat $BUILDDIR/.toastermain.pid`; then - echo "Warning: bitbake appears to be dead, but the Toaster web server is running." 1>&2 - echo " Something fishy is going on." 1>&2 - echo "Cleaning up the web server to start from a clean slate." - webserverKillAll - fi - # Create configuration file conf=${BUILDDIR}/conf/local.conf line='INHERIT+="toaster buildhistory"'
Signature · 1 line
2.7.4
PATCH 10/11 toaster: remove handling of .toasterui.pid
In reply to Michael WoodFrom: Ed Bartosh <[email protected]>
This file is not created anywhere, but handled in toaster script code.
--- bin/toaster | 4 ---- 1 file changed, 4 deletions(-)
bin/toaster +0 -4
@@ -95,10 +95,6 @@ stop_system() # prevent reentry if [ $INSTOPSYSTEM -eq 1 ]; then return; fi INSTOPSYSTEM=1 - if [ -f ${BUILDDIR}/.toasterui.pid ]; then - kill `cat ${BUILDDIR}/.toasterui.pid` 2>/dev/null - rm ${BUILDDIR}/.toasterui.pid - fi webserverKillAll # unset exported variables unset TOASTER_DIR
Signature · 1 line
2.7.4
PATCH 11/11 toaster: don't kill all runserver processes
In reply to Michael WoodFrom: Ed Bartosh <[email protected]>
Toaster script kills runserver process 2 ways:
- sending signal to pid from .toastermain.pid.
- sending signal to pids found by grepping ps output:
ps fux | grep "python.*manage.py runserver"
Second approach is redundant and harmfull as it kills all django development server running on the machine.
[YOCTO #7973]
--- bin/toaster | 3 --- 1 file changed, 3 deletions(-)
bin/toaster +0 -3
@@ -33,9 +33,6 @@ webserverKillAll() while kill -0 $pid 2>/dev/null; do kill -SIGTERM -$pid 2>/dev/null sleep 1 - # Kill processes if they are still running - may happen - # in interactive shells - ps fux | grep "python.*manage.py runserver" | awk '{print $2}' | xargs kill done rm ${pidfile} fi
Signature · 1 line
2.7.4