[oe-commits] [bitbake] 12/18: toaster: Allow forward slash in variable names

git at git.openembedded.org git at git.openembedded.org
Tue Sep 6 09:37:47 UTC 2016


rpurdie pushed a commit to branch master-next
in repository bitbake.

commit 146f6f95a8753308edb31e952d7c440c8de11870
Author: Belen Barros Pena <belen.barros.pena at linux.intel.com>
AuthorDate: Mon Sep 5 15:29:27 2016 +0100

    toaster: Allow forward slash in variable names
    
    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]
    
    Signed-off-by: Belen Barros Pena <belen.barros.pena at linux.intel.com>
    Signed-off-by: Michael Wood <michael.g.wood at intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/toaster/toastergui/static/css/default.css     | 1 +
 lib/toaster/toastergui/templates/projectconf.html | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/lib/toaster/toastergui/static/css/default.css b/lib/toaster/toastergui/static/css/default.css
index 88fe864..ff24e8c 100644
--- a/lib/toaster/toastergui/static/css/default.css
+++ b/lib/toaster/toastergui/static/css/default.css
@@ -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; }
diff --git a/lib/toaster/toastergui/templates/projectconf.html b/lib/toaster/toastergui/templates/projectconf.html
index c3ed216..fcf6df2 100644
--- a/lib/toaster/toastergui/templates/projectconf.html
+++ b/lib/toaster/toastergui/templates/projectconf.html
@@ -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) {

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list