summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDongxiao Xu <dongxiao.xu@intel.com>2012-05-22 11:08:34 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-05-22 14:56:16 +0100
commit7690c45c711853c8df64b338847263488c56fcae (patch)
tree42ff4bcf38a9dfa36d7637fb1e59f814eb06d9a9
parente069e53536e4894507a72da79e7e8af55a0d31b1 (diff)
downloadpoky-7690c45c711853c8df64b338847263488c56fcae.tar.gz
Hob: Add filter for images listed in image combo
Define BBUI_IMAGE_WHITE_PATTERN variable to indicate which image is allowed to be displayed in image combobox. Define BBUI_IMAGE_BLACK_PATTERN variable to indicate which image is NOT allowed to be displayed in image combobox. This fixes [YOCTO #1581] (Bitbake rev: 960461bc12945675af3081eb469f932f4a6eb1cd) Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xbitbake/lib/bb/ui/crumbs/builder.py4
-rw-r--r--bitbake/lib/bb/ui/crumbs/hobeventhandler.py2
-rw-r--r--bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py37
3 files changed, 39 insertions, 4 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index 3282fdf52c..299981c3bb 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -279,6 +279,8 @@ class Parameters:
279 self.all_sdk_machines = [] 279 self.all_sdk_machines = []
280 self.all_layers = [] 280 self.all_layers = []
281 self.image_names = [] 281 self.image_names = []
282 self.image_white_pattern = ""
283 self.image_black_pattern = ""
282 284
283 # for build log to show 285 # for build log to show
284 self.bb_version = "" 286 self.bb_version = ""
@@ -296,6 +298,8 @@ class Parameters:
296 self.runnable_machine_patterns = params["runnable_machine_patterns"].split() 298 self.runnable_machine_patterns = params["runnable_machine_patterns"].split()
297 self.deployable_image_types = params["deployable_image_types"].split() 299 self.deployable_image_types = params["deployable_image_types"].split()
298 self.tmpdir = params["tmpdir"] 300 self.tmpdir = params["tmpdir"]
301 self.image_white_pattern = params["image_white_pattern"]
302 self.image_black_pattern = params["image_black_pattern"]
299 # for build log to show 303 # for build log to show
300 self.bb_version = params["bb_version"] 304 self.bb_version = params["bb_version"]
301 self.target_arch = params["target_arch"] 305 self.target_arch = params["target_arch"]
diff --git a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
index d2f4589774..7303ff8df1 100644
--- a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
+++ b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
@@ -497,4 +497,6 @@ class HobHandler(gobject.GObject):
497 params["cvs_proxy_host"] = self.runCommand(["getVariable", "CVS_PROXY_HOST"]) or "" 497 params["cvs_proxy_host"] = self.runCommand(["getVariable", "CVS_PROXY_HOST"]) or ""
498 params["cvs_proxy_port"] = self.runCommand(["getVariable", "CVS_PROXY_PORT"]) or "" 498 params["cvs_proxy_port"] = self.runCommand(["getVariable", "CVS_PROXY_PORT"]) or ""
499 499
500 params["image_white_pattern"] = self.runCommand(["getVariable", "BBUI_IMAGE_WHITE_PATTERN"]) or ""
501 params["image_black_pattern"] = self.runCommand(["getVariable", "BBUI_IMAGE_BLACK_PATTERN"]) or ""
500 return params 502 return params
diff --git a/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py b/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
index 95d48b9836..20a398cf50 100644
--- a/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
+++ b/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
@@ -22,6 +22,7 @@
22 22
23import gtk 23import gtk
24import glib 24import glib
25import re
25from bb.ui.crumbs.progressbar import HobProgressBar 26from bb.ui.crumbs.progressbar import HobProgressBar
26from bb.ui.crumbs.hobcolor import HobColors 27from bb.ui.crumbs.hobcolor import HobColors
27from bb.ui.crumbs.hobwidget import hic, HobImageButton, HobInfoButton, HobAltButton, HobButton 28from bb.ui.crumbs.hobwidget import hic, HobImageButton, HobInfoButton, HobAltButton, HobButton
@@ -345,6 +346,16 @@ class ImageConfigurationPage (HobPage):
345 active = -1 346 active = -1
346 cnt = 0 347 cnt = 0
347 348
349 white_pattern = []
350 if self.builder.parameters.image_white_pattern:
351 for i in self.builder.parameters.image_white_pattern.split():
352 white_pattern.append(re.compile(i))
353
354 black_pattern = []
355 if self.builder.parameters.image_black_pattern:
356 for i in self.builder.parameters.image_black_pattern.split():
357 black_pattern.append(re.compile(i))
358
348 it = image_model.get_iter_first() 359 it = image_model.get_iter_first()
349 self._image_combo_disconnect_signal() 360 self._image_combo_disconnect_signal()
350 model = self.image_combo.get_model() 361 model = self.image_combo.get_model()
@@ -356,10 +367,28 @@ class ImageConfigurationPage (HobPage):
356 image_name = image_model[path][recipe_model.COL_NAME] 367 image_name = image_model[path][recipe_model.COL_NAME]
357 if image_name == self.builder.recipe_model.__dummy_image__: 368 if image_name == self.builder.recipe_model.__dummy_image__:
358 continue 369 continue
359 self.image_combo.append_text(image_name) 370
360 if image_name == selected_image: 371 if black_pattern:
361 active = cnt 372 allow = True
362 cnt = cnt + 1 373 for pattern in black_pattern:
374 if pattern.search(image_name):
375 allow = False
376 break
377 elif white_pattern:
378 allow = False
379 for pattern in white_pattern:
380 if pattern.search(image_name):
381 allow = True
382 break
383 else:
384 allow = True
385
386 if allow:
387 self.image_combo.append_text(image_name)
388 if image_name == selected_image:
389 active = cnt
390 cnt = cnt + 1
391
363 self.image_combo.append_text(self.builder.recipe_model.__dummy_image__) 392 self.image_combo.append_text(self.builder.recipe_model.__dummy_image__)
364 if selected_image == self.builder.recipe_model.__dummy_image__: 393 if selected_image == self.builder.recipe_model.__dummy_image__:
365 active = cnt 394 active = cnt