* [PATCH 0/2] toaster: cummulative 14092017 patch
@ 2017-09-14 23:58 David Reyna
2017-09-14 23:58 ` [PATCH 1/2] toaster: reserve HEAD from imported layers David Reyna
2017-09-14 23:58 ` [PATCH 2/2] toaster: allow dots in user path names David Reyna
0 siblings, 2 replies; 3+ messages in thread
From: David Reyna @ 2017-09-14 23:58 UTC (permalink / raw)
To: bitbake-devel
From: David Reyna <David.Reyna@windriver.com>
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(-)
--
1.9.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] toaster: reserve HEAD from imported layers
2017-09-14 23:58 [PATCH 0/2] toaster: cummulative 14092017 patch David Reyna
@ 2017-09-14 23:58 ` David Reyna
2017-09-14 23:58 ` [PATCH 2/2] toaster: allow dots in user path names David Reyna
1 sibling, 0 replies; 3+ messages in thread
From: David Reyna @ 2017-09-14 23:58 UTC (permalink / raw)
To: bitbake-devel
From: David Reyna <David.Reyna@windriver.com>
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]
Signed-off-by: David Reyna <David.Reyna@windriver.com>
---
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(-)
diff --git a/lib/toaster/toastergui/api.py b/lib/toaster/toastergui/api.py
index cb8f0f3..ab6ba69 100644
--- a/lib/toaster/toastergui/api.py
+++ b/lib/toaster/toastergui/api.py
@@ -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()
diff --git a/lib/toaster/toastergui/static/js/importlayer.js b/lib/toaster/toastergui/static/js/importlayer.js
index b3f094e..59652b9 100644
--- a/lib/toaster/toastergui/static/js/importlayer.js
+++ b/lib/toaster/toastergui/static/js/importlayer.js
@@ -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);
+ }
}
}
diff --git a/lib/toaster/toastergui/templates/importlayer.html b/lib/toaster/toastergui/templates/importlayer.html
index afbeb94..7e5253e 100644
--- a/lib/toaster/toastergui/templates/importlayer.html
+++ b/lib/toaster/toastergui/templates/importlayer.html
@@ -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>
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] toaster: allow dots in user path names
2017-09-14 23:58 [PATCH 0/2] toaster: cummulative 14092017 patch David Reyna
2017-09-14 23:58 ` [PATCH 1/2] toaster: reserve HEAD from imported layers David Reyna
@ 2017-09-14 23:58 ` David Reyna
1 sibling, 0 replies; 3+ messages in thread
From: David Reyna @ 2017-09-14 23:58 UTC (permalink / raw)
To: bitbake-devel
From: David Reyna <David.Reyna@windriver.com>
The dot '.' character should be allowed in the user paths for
local non-git layers, DL_DIR, and SSTATE_DIR.
[YOCTO #10650]
Signed-off-by: David Reyna <David.Reyna@windriver.com>
---
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(-)
diff --git a/lib/toaster/toastergui/static/js/importlayer.js b/lib/toaster/toastergui/static/js/importlayer.js
index 59652b9..2964839 100644
--- a/lib/toaster/toastergui/static/js/importlayer.js
+++ b/lib/toaster/toastergui/static/js/importlayer.js
@@ -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());
diff --git a/lib/toaster/toastergui/templates/importlayer.html b/lib/toaster/toastergui/templates/importlayer.html
index 7e5253e..97d52c7 100644
--- a/lib/toaster/toastergui/templates/importlayer.html
+++ b/lib/toaster/toastergui/templates/importlayer.html
@@ -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>
diff --git a/lib/toaster/toastergui/templates/projectconf.html b/lib/toaster/toastergui/templates/projectconf.html
index 0e9712b..933c588 100644
--- a/lib/toaster/toastergui/templates/projectconf.html
+++ b/lib/toaster/toastergui/templates/projectconf.html
@@ -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());
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-09-15 0:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-14 23:58 [PATCH 0/2] toaster: cummulative 14092017 patch David Reyna
2017-09-14 23:58 ` [PATCH 1/2] toaster: reserve HEAD from imported layers David Reyna
2017-09-14 23:58 ` [PATCH 2/2] toaster: allow dots in user path names David Reyna
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.