diff options
author | Elliot Smith <elliot.smith@intel.com> | 2016-04-19 17:28:41 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-04-19 21:11:25 +0100 |
commit | cfc22d3a9e2434fb5b9001850c19617dda6d57aa (patch) | |
tree | c90c1e55c48bf901288b2d22993e27c92fde0df6 /bitbake/lib/toaster/toastergui/static | |
parent | 3036413000786499d38026ae0c16b916a10b7c65 (diff) | |
download | poky-cfc22d3a9e2434fb5b9001850c19617dda6d57aa.tar.gz |
bitbake: toaster: only prevent duplicate custom image names within a project
We currently prevent the same name being used for multiple custom
images, but make the check across all projects. This means that
custom image names have to be unique across all projects in
the Toaster installation.
Modify how we validate the name of a custom image so that we
only prevent duplication of custom image names within a project,
while ensuring that the name of a custom image doesn't duplicate
the name of a recipe which is not a custom image recipe.
[YOCTO #9209]
(Bitbake rev: 9abbb46e799c06757e03addd54e3f5d3c0fe2886)
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/static')
-rw-r--r-- | bitbake/lib/toaster/toastergui/static/js/newcustomimage_modal.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/newcustomimage_modal.js b/bitbake/lib/toaster/toastergui/static/js/newcustomimage_modal.js index 328997af3b..98e87f4a6b 100644 --- a/bitbake/lib/toaster/toastergui/static/js/newcustomimage_modal.js +++ b/bitbake/lib/toaster/toastergui/static/js/newcustomimage_modal.js | |||
@@ -9,6 +9,8 @@ function newCustomImageModalInit(){ | |||
9 | var nameInput = imgCustomModal.find('input'); | 9 | var nameInput = imgCustomModal.find('input'); |
10 | 10 | ||
11 | var invalidMsg = "Image names cannot contain spaces or capital letters. The only allowed special character is dash (-)."; | 11 | var invalidMsg = "Image names cannot contain spaces or capital letters. The only allowed special character is dash (-)."; |
12 | var duplicateImageMsg = "An image with this name already exists in this project."; | ||
13 | var duplicateRecipeMsg = "A non-image recipe with this name already exists."; | ||
12 | 14 | ||
13 | newCustomImgBtn.click(function(e){ | 15 | newCustomImgBtn.click(function(e){ |
14 | e.preventDefault(); | 16 | e.preventDefault(); |
@@ -22,8 +24,10 @@ function newCustomImageModalInit(){ | |||
22 | console.warn(ret.error); | 24 | console.warn(ret.error); |
23 | if (ret.error === "invalid-name") { | 25 | if (ret.error === "invalid-name") { |
24 | showError(invalidMsg); | 26 | showError(invalidMsg); |
25 | } else if (ret.error === "already-exists") { | 27 | } else if (ret.error === "image-already-exists") { |
26 | showError("An image with this name already exists. Image names must be unique."); | 28 | showError(duplicateImageMsg); |
29 | } else if (ret.error === "recipe-already-exists") { | ||
30 | showError(duplicateRecipeMsg); | ||
27 | } | 31 | } |
28 | } else { | 32 | } else { |
29 | imgCustomModal.modal('hide'); | 33 | imgCustomModal.modal('hide'); |