toaster: cummulative 14092017 patch
cover toaster: cummulative 14092017 patch
From: David Reyna <[email protected]>
This patch set fixes larger and small issues with importing layers into Toaster. There are no new files.
The following changes since commit abea8ec5063998e0e2b822be7704c0d14569df0e:
meta-yocto: Restructure and tidy up READMEs (2017-09-14 13:36:22 +0100)
are available in the git repository at:
git://git.yoctoproject.org/poky-contrib dreyna/submit/dreyna/toaster/cummulative_140917_patch
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=dreyna/submit/dreyna/toaster/cummulative_140917_patch
David Reyna (2):
toaster: reserve HEAD from imported layers
toaster: allow dots in user path names
lib/toaster/toastergui/api.py | 6 +++--- lib/toaster/toastergui/static/js/importlayer.js | 19 +++++++++++++++---- lib/toaster/toastergui/templates/importlayer.html | 4 ++-- lib/toaster/toastergui/templates/projectconf.html | 8 ++++---- 4 files changed, 24 insertions(+), 13 deletions(-)
Signature · 1 line
1.9.1
PATCH 1/2 toaster: reserve HEAD from imported layers
From: David Reyna <[email protected]>
The HEAD reference in Toaster layers are reserved for the "Local Yocto Project" layers, stored at the top directory. Imported layers are not allowed to use this since they are managed differently - for example the 'remotes' will collide.
Fix the add layer handler to not drop the data fields when it is a git repo.
Explicitly inform the user when an internal Toaster error is returned via AJAX, so that they know why clicking the layer add button did not do anything.
[YOCTO #9924]
--- lib/toaster/toastergui/api.py | 6 +++--- lib/toaster/toastergui/static/js/importlayer.js | 17 ++++++++++++++--- lib/toaster/toastergui/templates/importlayer.html | 2 +- 3 files changed, 18 insertions(+), 7 deletions(-)
lib/toaster/toastergui/api.py +3 -3
@@ -293,14 +293,14 @@ class XhrLayer(View): layer_source=LayerSource.TYPE_IMPORTED) # Local layer - if 'local_source_dir' in layer_data: + if ('local_source_dir' in layer_data) and layer.local_source_dir: layer.local_source_dir = layer_data['local_source_dir'] # git layer elif 'vcs_url' in layer_data: layer.vcs_url = layer_data['vcs_url'] layer_version.dirpath = layer_data['dir_path'] - layer_version.commit = layer_data['get_ref'] - layer_version.branch = layer_data['get_ref'] + layer_version.commit = layer_data['git_ref'] + layer_version.branch = layer_data['git_ref'] layer.save() layer_version.save()
lib/toaster/toastergui/static/js/importlayer.js +14 -3
@@ -176,6 +176,8 @@ function importLayerPageInit (ctx) { success: function (data) { if (data.error != "ok") { console.log(data.error); + /* let the user know why nothing happened */ + alert(data.error) } else { createImportedNotification(data); window.location.replace(libtoaster.ctx.projectPageUrl);
@@ -244,9 +246,18 @@ function importLayerPageInit (ctx) { enable_import_btn(true); } - if ($("#git-repo-radio").prop("checked") && - vcsURLInput.val().length > 0 && gitRefInput.val().length > 0) { - enable_import_btn(true); + if ($("#git-repo-radio").prop("checked")) { + if (gitRefInput.val().length > 0 && + gitRefInput.val() == 'HEAD') { + $('#invalid-layer-revision-hint').show(); + $('#layer-revision-ctrl').addClass('has-error'); + enable_import_btn(false); + } else if (vcsURLInput.val().length > 0 && + gitRefInput.val().length > 0) { + $('#invalid-layer-revision-hint').hide(); + $('#layer-revision-ctrl').removeClass('has-error'); + enable_import_btn(true); + } } }
lib/toaster/toastergui/templates/importlayer.html +1 -1
@@ -115,8 +115,8 @@ </label> <span style="display: block"> <input type="text" class="form-control" id="layer-git-ref" autocomplete="off" data-minLength="1" data-autocomplete="off" data-provide="typeahead" required> - <span class="help-inline" style="display:none;" id="invalid-layer-revision-hint"></span> </span> + <span class="help-block has-error" style="display:none;" id="invalid-layer-revision-hint">The "HEAD" branch is reserved (only allowed for the "Local Yocto Project" layers)</span> </div> </fieldset>
Signature · 1 line
1.9.1
PATCH 2/2 toaster: allow dots in user path names
In reply to David ReynaFrom: David Reyna <[email protected]>
The dot '.' character should be allowed in the user paths for local non-git layers, DL_DIR, and SSTATE_DIR.
[YOCTO #10650]
--- lib/toaster/toastergui/static/js/importlayer.js | 2 +- lib/toaster/toastergui/templates/importlayer.html | 2 +- lib/toaster/toastergui/templates/projectconf.html | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-)
lib/toaster/toastergui/static/js/importlayer.js +1 -1
@@ -418,7 +418,7 @@ function importLayerPageInit (ctx) { var input = $(this); var reBeginWithSlash = /^\//; var reCheckVariable = /^\$/; - var re = /([ <>\\|":\.%\?\*]+)/; + var re = /([ <>\\|":%\?\*]+)/; var invalidDir = re.test(input.val()); var invalidSlash = reBeginWithSlash.test(input.val());
lib/toaster/toastergui/templates/importlayer.html +1 -1
@@ -126,7 +126,7 @@ <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> + <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>
lib/toaster/toastergui/templates/projectconf.html +4 -4
@@ -41,7 +41,7 @@ </div> <button id="apply-change-dl_dir" class="btn btn-default" type="button">Save</button> <button id="cancel-change-dl_dir" type="button" class="btn btn-link">Cancel</button> - <p class="help-block" id="hintError-dl_dir" style="display:none;">The directory path cannot include spaces or any of these characters: . \ ? % * : | " " < ></p> + <p class="help-block" id="hintError-dl_dir" style="display:none;">The directory path cannot include spaces or any of these characters: \ ? % * : | " " < ></p> <p class="help-block" id="hintError-initialChar-dl_dir" style="display:none;">The directory path should either start with a /, e.g. /home/toaster/downloads; or with a variable, e.g. ${TOPDIR}/downloads.</p> </form> </dd>
@@ -151,7 +151,7 @@ </div> <button id="apply-change-sstate_dir" class="btn btn-default" type="button">Save</button> <button id="cancel-change-sstate_dir" type="button" class="btn btn-link">Cancel</button> - <p class="help-block" id="hintError-sstate_dir" style="display:none;">The directory path cannot include spaces or any of these characters: . \ ? % * : | " " < ></p> + <p class="help-block" id="hintError-sstate_dir" style="display:none;">The directory path cannot include spaces or any of these characters: \ ? % * : | " " < ></p> <p class="help-block" id="hintError-initialChar-sstate_dir" style="display:none;">The directory path should either start with a /, e.g. /home/toaster/sstate-cache; or with a variable, e.g. ${TOPDIR}/sstate-cache.</p> </form> </dd>
@@ -594,7 +594,7 @@ $(document).ready(function() { var input = $(this); var reBeginWithSlash = /^\//; var reCheckVariable = /^\$/; - var re = /([ <>\\|":\.%\?\*]+)/; + var re = /([ <>\\|":%\?\*]+)/; var invalidDir = re.test(input.val()); var invalidSlash = reBeginWithSlash.test(input.val()); var invalidVar = reCheckVariable.test(input.val());
@@ -961,7 +961,7 @@ $(document).ready(function() { var input = $(this); var reBeginWithSlash = /^\//; var reCheckVariable = /^\$/; - var re = /([ <>\\|":\.%\?\*]+)/; + var re = /([ <>\\|":%\?\*]+)/; var invalidDir = re.test(input.val()); var invalidSlash = reBeginWithSlash.test(input.val()); var invalidVar = reCheckVariable.test(input.val());
Signature · 1 line
1.9.1