aboutsummaryrefslogtreecommitdiffstats
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:38:09 +0100
commit960461bc12945675af3081eb469f932f4a6eb1cd (patch)
tree36910b3f68a78a1cb151b52f672547073ca8bfb9
parent911a60c09c1539a3f10c2bcdb26d40e458c31303 (diff)
downloadbitbake-960461bc12945675af3081eb469f932f4a6eb1cd.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] Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xlib/bb/ui/crumbs/builder.py4
-rw-r--r--lib/bb/ui/crumbs/hobeventhandler.py2
-rw-r--r--lib/bb/ui/crumbs/imageconfigurationpage.py37
3 files changed, 39 insertions, 4 deletions
diff --git a/lib/bb/ui/crumbs/builder.py b/lib/bb/ui/crumbs/builder.py
index 3282fdf52..299981c3b 100755
--- a/lib/bb/ui/crumbs/builder.py
+++ b/lib/bb/ui/crumbs/builder.py
@@ -279,6 +279,8 @@ class Parameters:
self.all_sdk_machines = []
self.all_layers = []
self.image_names = []
+ self.image_white_pattern = ""
+ self.image_black_pattern = ""
# for build log to show
self.bb_version = ""
@@ -296,6 +298,8 @@ class Parameters:
self.runnable_machine_patterns = params["runnable_machine_patterns"].split()
self.deployable_image_types = params["deployable_image_types"].split()
self.tmpdir = params["tmpdir"]
+ self.image_white_pattern = params["image_white_pattern"]
+ self.image_black_pattern = params["image_black_pattern"]
# for build log to show
self.bb_version = params["bb_version"]
self.target_arch = params["target_arch"]
diff --git a/lib/bb/ui/crumbs/hobeventhandler.py b/lib/bb/ui/crumbs/hobeventhandler.py
index d2f458977..7303ff8df 100644
--- a/lib/bb/ui/crumbs/hobeventhandler.py
+++ b/lib/bb/ui/crumbs/hobeventhandler.py
@@ -497,4 +497,6 @@ class HobHandler(gobject.GObject):
params["cvs_proxy_host"] = self.runCommand(["getVariable", "CVS_PROXY_HOST"]) or ""
params["cvs_proxy_port"] = self.runCommand(["getVariable", "CVS_PROXY_PORT"]) or ""
+ params["image_white_pattern"] = self.runCommand(["getVariable", "BBUI_IMAGE_WHITE_PATTERN"]) or ""
+ params["image_black_pattern"] = self.runCommand(["getVariable", "BBUI_IMAGE_BLACK_PATTERN"]) or ""
return params
diff --git a/lib/bb/ui/crumbs/imageconfigurationpage.py b/lib/bb/ui/crumbs/imageconfigurationpage.py
index 95d48b983..20a398cf5 100644
--- a/lib/bb/ui/crumbs/imageconfigurationpage.py
+++ b/lib/bb/ui/crumbs/imageconfigurationpage.py
@@ -22,6 +22,7 @@
import gtk
import glib
+import re
from bb.ui.crumbs.progressbar import HobProgressBar
from bb.ui.crumbs.hobcolor import HobColors
from bb.ui.crumbs.hobwidget import hic, HobImageButton, HobInfoButton, HobAltButton, HobButton
@@ -345,6 +346,16 @@ class ImageConfigurationPage (HobPage):
active = -1
cnt = 0
+ white_pattern = []
+ if self.builder.parameters.image_white_pattern:
+ for i in self.builder.parameters.image_white_pattern.split():
+ white_pattern.append(re.compile(i))
+
+ black_pattern = []
+ if self.builder.parameters.image_black_pattern:
+ for i in self.builder.parameters.image_black_pattern.split():
+ black_pattern.append(re.compile(i))
+
it = image_model.get_iter_first()
self._image_combo_disconnect_signal()
model = self.image_combo.get_model()
@@ -356,10 +367,28 @@ class ImageConfigurationPage (HobPage):
image_name = image_model[path][recipe_model.COL_NAME]
if image_name == self.builder.recipe_model.__dummy_image__:
continue
- self.image_combo.append_text(image_name)
- if image_name == selected_image:
- active = cnt
- cnt = cnt + 1
+
+ if black_pattern:
+ allow = True
+ for pattern in black_pattern:
+ if pattern.search(image_name):
+ allow = False
+ break
+ elif white_pattern:
+ allow = False
+ for pattern in white_pattern:
+ if pattern.search(image_name):
+ allow = True
+ break
+ else:
+ allow = True
+
+ if allow:
+ self.image_combo.append_text(image_name)
+ if image_name == selected_image:
+ active = cnt
+ cnt = cnt + 1
+
self.image_combo.append_text(self.builder.recipe_model.__dummy_image__)
if selected_image == self.builder.recipe_model.__dummy_image__:
active = cnt