Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 4386FE00B04; Mon, 5 Sep 2016 04:05:18 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id EBEC8E00A6D for ; Mon, 5 Sep 2016 04:05:14 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga104.jf.intel.com with ESMTP; 05 Sep 2016 04:05:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,286,1470726000"; d="scan'208";a="1025257064" Received: from icarus.ld.intel.com ([10.103.239.199]) by orsmga001.jf.intel.com with ESMTP; 05 Sep 2016 04:05:13 -0700 From: Belen Barros Pena To: toaster@yoctoproject.org Date: Mon, 5 Sep 2016 12:01:20 +0100 Message-Id: <1473073280-11489-1-git-send-email-belen.barros.pena@linux.intel.com> X-Mailer: git-send-email 1.9.1 Subject: [PATCH] toaster: Allow forward slash in variable names X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Sep 2016 11:05:18 -0000 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 --- bitbake/lib/toaster/toastergui/static/css/default.css | 1 + bitbake/lib/toaster/toastergui/templates/projectconf.html | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bitbake/lib/toaster/toastergui/static/css/default.css b/bitbake/lib/toaster/toastergui/static/css/default.css index a56bb8c..54d7cb6 100644 --- a/bitbake/lib/toaster/toastergui/static/css/default.css +++ b/bitbake/lib/toaster/toastergui/static/css/default.css @@ -176,6 +176,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/bitbake/lib/toaster/toastergui/templates/projectconf.html b/bitbake/lib/toaster/toastergui/templates/projectconf.html index c3ed216..fcf6df2 100644 --- a/bitbake/lib/toaster/toastergui/templates/projectconf.html +++ b/bitbake/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 _ - /. 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 _ - /"; } if ("" != error_msg) { -- 1.9.1