diff options
author | Kang Kai <kai.kang@windriver.com> | 2012-08-28 10:47:19 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-09-07 12:10:40 +0100 |
commit | da98eddd02118f4330d05a1262617ba84029a13a (patch) | |
tree | 4b83207a134eb375acd2ba126148ab1853bb0439 /bitbake/lib/bb/ui/crumbs/hig.py | |
parent | 15abf2571ceca8634580538b8635487dbc7c0dd5 (diff) | |
download | poky-da98eddd02118f4330d05a1262617ba84029a13a.tar.gz |
bitbake: hob2: remove the hard-coded images map
[Yocto #2795]
When a new image type added, the hob will crash because the new type is
not in the hard-coded image dictionary.
For most of the image types, they are same with the image file's
extension name. So use variable "IMAGE_EXTENSION_difftype" to map the
image type which is diff with the image file extension name, such as
type "live". And the variable(s) will be set in image_types.bbclass.
(Bitbake rev: e7c84f056af9c613920d5adcd078a011e0387193)
Signed-off-by: Kang Kai <kai.kang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui/crumbs/hig.py')
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/hig.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/hig.py b/bitbake/lib/bb/ui/crumbs/hig.py index 2001ff424f..6829927e1a 100644 --- a/bitbake/lib/bb/ui/crumbs/hig.py +++ b/bitbake/lib/bb/ui/crumbs/hig.py | |||
@@ -1172,7 +1172,7 @@ class ImageSelectionDialog (CrumbsDialog): | |||
1172 | }] | 1172 | }] |
1173 | 1173 | ||
1174 | 1174 | ||
1175 | def __init__(self, image_folder, image_types, title, parent, flags, buttons=None): | 1175 | def __init__(self, image_folder, image_types, title, parent, flags, buttons=None, image_extension = {}): |
1176 | super(ImageSelectionDialog, self).__init__(title, parent, flags, buttons) | 1176 | super(ImageSelectionDialog, self).__init__(title, parent, flags, buttons) |
1177 | self.connect("response", self.response_cb) | 1177 | self.connect("response", self.response_cb) |
1178 | 1178 | ||
@@ -1180,6 +1180,7 @@ class ImageSelectionDialog (CrumbsDialog): | |||
1180 | self.image_types = image_types | 1180 | self.image_types = image_types |
1181 | self.image_list = [] | 1181 | self.image_list = [] |
1182 | self.image_names = [] | 1182 | self.image_names = [] |
1183 | self.image_extension = image_extension | ||
1183 | 1184 | ||
1184 | # create visual elements on the dialog | 1185 | # create visual elements on the dialog |
1185 | self.create_visual_elements() | 1186 | self.create_visual_elements() |
@@ -1265,7 +1266,11 @@ class ImageSelectionDialog (CrumbsDialog): | |||
1265 | dirs[:] = [] | 1266 | dirs[:] = [] |
1266 | for f in files: | 1267 | for f in files: |
1267 | for image_type in self.image_types: | 1268 | for image_type in self.image_types: |
1268 | for real_image_type in hcc.SUPPORTED_IMAGE_TYPES[image_type]: | 1269 | if image_type in self.image_extension: |
1270 | real_types = self.image_extension[image_type] | ||
1271 | else: | ||
1272 | real_types = [image_type] | ||
1273 | for real_image_type in real_types: | ||
1269 | if f.endswith('.' + real_image_type): | 1274 | if f.endswith('.' + real_image_type): |
1270 | imageset.add(f.rsplit('.' + real_image_type)[0].rsplit('.rootfs')[0]) | 1275 | imageset.add(f.rsplit('.' + real_image_type)[0].rsplit('.rootfs')[0]) |
1271 | self.image_list.append(f) | 1276 | self.image_list.append(f) |