From da98eddd02118f4330d05a1262617ba84029a13a Mon Sep 17 00:00:00 2001 From: Kang Kai Date: Tue, 28 Aug 2012 10:47:19 +0800 Subject: 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 Signed-off-by: Richard Purdie --- bitbake/lib/bb/ui/crumbs/hig.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'bitbake/lib/bb/ui/crumbs/hig.py') 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): }] - def __init__(self, image_folder, image_types, title, parent, flags, buttons=None): + def __init__(self, image_folder, image_types, title, parent, flags, buttons=None, image_extension = {}): super(ImageSelectionDialog, self).__init__(title, parent, flags, buttons) self.connect("response", self.response_cb) @@ -1180,6 +1180,7 @@ class ImageSelectionDialog (CrumbsDialog): self.image_types = image_types self.image_list = [] self.image_names = [] + self.image_extension = image_extension # create visual elements on the dialog self.create_visual_elements() @@ -1265,7 +1266,11 @@ class ImageSelectionDialog (CrumbsDialog): dirs[:] = [] for f in files: for image_type in self.image_types: - for real_image_type in hcc.SUPPORTED_IMAGE_TYPES[image_type]: + if image_type in self.image_extension: + real_types = self.image_extension[image_type] + else: + real_types = [image_type] + for real_image_type in real_types: if f.endswith('.' + real_image_type): imageset.add(f.rsplit('.' + real_image_type)[0].rsplit('.rootfs')[0]) self.image_list.append(f) -- cgit v1.2.3-54-g00ecf