summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCristiana Voicu <cristiana.voicu@intel.com>2012-11-26 09:42:36 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-11-26 20:57:30 +0000
commit73b9f64357f03da95c5d4b4d0d56ff1bb1e3ff0d (patch)
tree80e061dda4e56d54a6774182d14237f53b4a8f80
parentc6dc0b976776b94ba92a7be6d69ac3fe605eff2a (diff)
downloadpoky-73b9f64357f03da95c5d4b4d0d56ff1bb1e3ff0d.tar.gz
bitbake: hob: make some layers non removable
- there are some layers which cannot be removed; so ,I have used a new variable called BBLAYERS_NON_REMOVABLE located in bblayers.conf, which contains those layers which cannot be deleted - "meta-hob" layer is added to this variable in hob code, like it's added to BBLAYERS var [YOCTO #3176] (Bitbake rev: 05da1621eed4c6201cd65372d229f63ea8a44b6e) Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xbitbake/lib/bb/ui/crumbs/builder.py2
-rw-r--r--bitbake/lib/bb/ui/crumbs/hig.py15
-rw-r--r--bitbake/lib/bb/ui/crumbs/hobeventhandler.py3
3 files changed, 10 insertions, 10 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index d10c681df9..2f3d6d0c6c 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -172,6 +172,7 @@ class Configuration:
172 # self.extra_setting/self.toolchain_build 172 # self.extra_setting/self.toolchain_build
173 # bblayers.conf 173 # bblayers.conf
174 self.layers = params["layer"].split() 174 self.layers = params["layer"].split()
175 self.layers_non_removable = params["layers_non_removable"].split()
175 self.default_task = params["default_task"] 176 self.default_task = params["default_task"]
176 177
177 # proxy settings 178 # proxy settings
@@ -1200,6 +1201,7 @@ class Builder(gtk.Window):
1200 def show_layer_selection_dialog(self): 1201 def show_layer_selection_dialog(self):
1201 dialog = LayerSelectionDialog(title = "Layers", 1202 dialog = LayerSelectionDialog(title = "Layers",
1202 layers = copy.deepcopy(self.configuration.layers), 1203 layers = copy.deepcopy(self.configuration.layers),
1204 layers_non_removable = copy.deepcopy(self.configuration.layers_non_removable),
1203 all_layers = self.parameters.all_layers, 1205 all_layers = self.parameters.all_layers,
1204 parent = self, 1206 parent = self,
1205 flags = gtk.DIALOG_MODAL 1207 flags = gtk.DIALOG_MODAL
diff --git a/bitbake/lib/bb/ui/crumbs/hig.py b/bitbake/lib/bb/ui/crumbs/hig.py
index d973086102..e56cf2a759 100644
--- a/bitbake/lib/bb/ui/crumbs/hig.py
+++ b/bitbake/lib/bb/ui/crumbs/hig.py
@@ -1665,11 +1665,12 @@ class LayerSelectionDialog (CrumbsDialog):
1665 def add_leave_cb(self, button, event): 1665 def add_leave_cb(self, button, event):
1666 self.im.set_from_file(hic.ICON_INDI_ADD_FILE) 1666 self.im.set_from_file(hic.ICON_INDI_ADD_FILE)
1667 1667
1668 def __init__(self, title, layers, all_layers, parent, flags, buttons=None): 1668 def __init__(self, title, layers, layers_non_removable, all_layers, parent, flags, buttons=None):
1669 super(LayerSelectionDialog, self).__init__(title, parent, flags, buttons) 1669 super(LayerSelectionDialog, self).__init__(title, parent, flags, buttons)
1670 1670
1671 # class members from other objects 1671 # class members from other objects
1672 self.layers = layers 1672 self.layers = layers
1673 self.layers_non_removable = layers_non_removable
1673 self.all_layers = all_layers 1674 self.all_layers = all_layers
1674 self.layers_changed = False 1675 self.layers_changed = False
1675 1676
@@ -1709,10 +1710,7 @@ class LayerSelectionDialog (CrumbsDialog):
1709 """ 1710 """
1710 def draw_delete_button_cb(self, col, cell, model, it, tv): 1711 def draw_delete_button_cb(self, col, cell, model, it, tv):
1711 path = model.get_value(it, 0) 1712 path = model.get_value(it, 0)
1712 # Trailing slashes are uncommon in bblayers.conf but confuse os.path.basename 1713 if path in self.layers_non_removable:
1713 path.rstrip('/')
1714 name = os.path.basename(path)
1715 if name == "meta" or name == "meta-hob":
1716 cell.set_sensitive(False) 1714 cell.set_sensitive(False)
1717 cell.set_property('pixbuf', None) 1715 cell.set_property('pixbuf', None)
1718 cell.set_property('mode', gtk.CELL_RENDERER_MODE_INERT) 1716 cell.set_property('mode', gtk.CELL_RENDERER_MODE_INERT)
@@ -1730,11 +1728,8 @@ class LayerSelectionDialog (CrumbsDialog):
1730 """ 1728 """
1731 def draw_layer_path_cb(self, col, cell, model, it): 1729 def draw_layer_path_cb(self, col, cell, model, it):
1732 path = model.get_value(it, 0) 1730 path = model.get_value(it, 0)
1733 name = os.path.basename(path) 1731 if path in self.layers_non_removable:
1734 if name == "meta": 1732 cell.set_property('markup', "<b>It cannot be removed</b>\n%s" % path)
1735 cell.set_property('markup', "<b>Core layer for images: it cannot be removed</b>\n%s" % path)
1736 elif name == "meta-hob":
1737 cell.set_property('markup', "<b>Core layer for Hob: it cannot be removed</b>\n%s" % path)
1738 else: 1733 else:
1739 cell.set_property('text', path) 1734 cell.set_property('text', path)
1740 1735
diff --git a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
index 4b908f9041..ae1cefc538 100644
--- a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
+++ b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
@@ -435,8 +435,11 @@ class HobHandler(gobject.GObject):
435 params["core_base"] = self.runCommand(["getVariable", "COREBASE"]) or "" 435 params["core_base"] = self.runCommand(["getVariable", "COREBASE"]) or ""
436 hob_layer = params["core_base"] + "/meta-hob" 436 hob_layer = params["core_base"] + "/meta-hob"
437 params["layer"] = self.runCommand(["getVariable", "BBLAYERS"]) or "" 437 params["layer"] = self.runCommand(["getVariable", "BBLAYERS"]) or ""
438 params["layers_non_removable"] = self.runCommand(["getVariable", "BBLAYERS_NON_REMOVABLE"])
438 if hob_layer not in params["layer"].split(): 439 if hob_layer not in params["layer"].split():
439 params["layer"] += (" " + hob_layer) 440 params["layer"] += (" " + hob_layer)
441 if hob_layer not in params["layers_non_removable"].split():
442 params["layers_non_removable"] += (" " + hob_layer)
440 params["dldir"] = self.runCommand(["getVariable", "DL_DIR"]) or "" 443 params["dldir"] = self.runCommand(["getVariable", "DL_DIR"]) or ""
441 params["machine"] = self.runCommand(["getVariable", "MACHINE"]) or "" 444 params["machine"] = self.runCommand(["getVariable", "MACHINE"]) or ""
442 params["distro"] = self.runCommand(["getVariable", "DISTRO"]) or "defaultsetup" 445 params["distro"] = self.runCommand(["getVariable", "DISTRO"]) or "defaultsetup"