All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joshua Lock <josh@linux.intel.com>
To: bitbake-devel@lists.openembedded.org
Subject: Re: [PATCH 3/7] Hob: Make layers define in bblayers.conf as default
Date: Fri, 30 Mar 2012 09:10:04 -0700	[thread overview]
Message-ID: <4F75DADC.7070909@linux.intel.com> (raw)
In-Reply-To: <9135f6b93e4fe1665f3bdc56eba150d67582d8e1.1333108781.git.dongxiao.xu@intel.com>



On 30/03/12 05:01, Dongxiao Xu wrote:
> For layers defined in bblayers.conf, we treat them as default layers
> and users are not allowed to remove them.

Can you explain the rationale behind this change? I see what you're 
doing but it's not entirely clear why.

I think this is a bad idea. Early on in the design of Hob we decided we 
didn't want configuration made for non-Hob builds to affect builds made 
with Hob, and vice versa.

Thanks,
Joshua

>
> Signed-off-by: Dongxiao Xu<dongxiao.xu@intel.com>
> ---
>   lib/bb/ui/crumbs/builder.py |    4 ++--
>   lib/bb/ui/crumbs/hig.py     |   23 +++++++++--------------
>   2 files changed, 11 insertions(+), 16 deletions(-)
>
> diff --git a/lib/bb/ui/crumbs/builder.py b/lib/bb/ui/crumbs/builder.py
> index 44b208a..3be799c 100755
> --- a/lib/bb/ui/crumbs/builder.py
> +++ b/lib/bb/ui/crumbs/builder.py
> @@ -178,7 +178,7 @@ class Parameters:
>           self.all_distros = []
>           self.all_sdk_machines = []
>           self.max_threads = params["max_threads"]
> -        self.all_layers = []
> +        self.layers_default = params["layer"].split()
>           self.core_base = params["core_base"]
>           self.image_names = []
>           self.image_addr = params["image_addr"]
> @@ -764,7 +764,7 @@ class Builder(gtk.Window):
>       def show_layer_selection_dialog(self):
>           dialog = LayerSelectionDialog(title = "Layers",
>                        layers = copy.deepcopy(self.configuration.layers),
> -                     all_layers = self.parameters.all_layers,
> +                     layers_default = self.parameters.layers_default,
>                        parent = self,
>                        flags = gtk.DIALOG_MODAL
>                            | gtk.DIALOG_DESTROY_WITH_PARENT
> diff --git a/lib/bb/ui/crumbs/hig.py b/lib/bb/ui/crumbs/hig.py
> index 9adb281..9a38bc0 100644
> --- a/lib/bb/ui/crumbs/hig.py
> +++ b/lib/bb/ui/crumbs/hig.py
> @@ -850,7 +850,7 @@ class LayerSelectionDialog (CrumbsDialog):
>               layer_store.remove(iter)
>
>
> -    def gen_layer_widget(self, layers, layers_avail, window, tooltip=""):
> +    def gen_layer_widget(self, layers, layers_default, window, tooltip=""):
>           hbox = gtk.HBox(False, 6)
>
>           layer_tv = gtk.TreeView()
> @@ -881,8 +881,8 @@ class LayerSelectionDialog (CrumbsDialog):
>           for layer in layers:
>               if layer.endswith("/meta"):
>                   core_iter = layer_store.prepend([layer])
> -            elif layer.endswith("/meta-hob") and core_iter:
> -                layer_store.insert_after(core_iter, [layer])
> +            elif layer in layers_default:
> +                core_iter = layer_store.insert_after(core_iter, [layer])
>               else:
>                   layer_store.append([layer])
>
> @@ -924,12 +924,12 @@ class LayerSelectionDialog (CrumbsDialog):
>       def add_leave_cb(self, button, event):
>           self.im.set_from_file(hic.ICON_INDI_ADD_FILE)
>
> -    def __init__(self, title, layers, all_layers, parent, flags, buttons=None):
> +    def __init__(self, title, layers, layers_default, parent, flags, buttons=None):
>           super(LayerSelectionDialog, self).__init__(title, parent, flags, buttons)
>
>           # class members from other objects
>           self.layers = layers
> -        self.all_layers = all_layers
> +        self.layers_default = layers_default
>           self.layers_changed = False
>
>           # icon for remove button in TreeView
> @@ -945,7 +945,7 @@ class LayerSelectionDialog (CrumbsDialog):
>           self.connect("response", self.response_cb)
>
>       def create_visual_elements(self):
> -        layer_widget, self.layer_store = self.gen_layer_widget(self.layers, self.all_layers, self, None)
> +        layer_widget, self.layer_store = self.gen_layer_widget(self.layers, self.layers_default, self, None)
>           layer_widget.set_size_request(450, 250)
>           self.vbox.pack_start(layer_widget, expand=True, fill=True)
>           self.show_all()
> @@ -972,9 +972,7 @@ class LayerSelectionDialog (CrumbsDialog):
>       def draw_delete_button_cb(self, col, cell, model, it, tv):
>           path =  model.get_value(it, 0)
>           # Trailing slashes are uncommon in bblayers.conf but confuse os.path.basename
> -        path.rstrip('/')
> -        name = os.path.basename(path)
> -        if name == "meta" or name == "meta-hob":
> +        if path in self.layers_default:
>               cell.set_sensitive(False)
>               cell.set_property('pixbuf', None)
>               cell.set_property('mode', gtk.CELL_RENDERER_MODE_INERT)
> @@ -992,11 +990,8 @@ class LayerSelectionDialog (CrumbsDialog):
>       """
>       def draw_layer_path_cb(self, col, cell, model, it):
>           path = model.get_value(it, 0)
> -        name = os.path.basename(path)
> -        if name == "meta":
> -            cell.set_property('markup', "<b>Core layer for images: it cannot be removed</b>\n%s" % path)
> -        elif name == "meta-hob":
> -            cell.set_property('markup', "<b>Core layer for Hob: it cannot be removed</b>\n%s" % path)
> +        if path in self.layers_default:
> +            cell.set_property('markup', "<b>Core layer: it cannot be removed</b>\n%s" % path)
>           else:
>               cell.set_property('text', path)
>

-- 
Joshua '贾詡' Lock
         Yocto Project "Johannes factotum"
         Intel Open Source Technology Centre



  reply	other threads:[~2012-03-30 16:19 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-30 12:01 [PATCH 0/7][PULL] Hob: Bug fixes Dongxiao Xu
2012-03-30 12:01 ` [PATCH 1/7] Hob: Fix MACHINE setting Dongxiao Xu
2012-03-30 12:01 ` [PATCH 2/7] Hob: Update the cache when setting changed Dongxiao Xu
2012-03-30 12:01 ` [PATCH 3/7] Hob: Make layers define in bblayers.conf as default Dongxiao Xu
2012-03-30 16:10   ` Joshua Lock [this message]
2012-03-31  0:32     ` Xu, Dongxiao
2012-03-31  5:29       ` Xu, Dongxiao
2012-03-31 15:51         ` Richard Purdie
2012-04-01  5:35           ` Xu, Dongxiao
2012-04-02 12:42             ` Richard Purdie
2012-04-02 12:55             ` Richard Purdie
2012-04-04  0:23               ` Joshua Lock
2012-04-08  2:00                 ` Wang, Shane
2012-03-30 12:01 ` [PATCH 4/7] Revert "lib/bb/ui/crumbs/hig: fix layers_changed test" Dongxiao Xu
2012-03-30 16:10   ` Joshua Lock
2012-03-31  0:32     ` Xu, Dongxiao
2012-03-30 12:01 ` [PATCH 5/7] Hob: Remove some calling of initiate_new_build() Dongxiao Xu
2012-03-30 12:01 ` [PATCH 6/7] Hob: Remove duplication for certain bitbake variables Dongxiao Xu
2012-03-30 12:01 ` [PATCH 7/7] Hob: Set stop button sensitive after task started Dongxiao Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F75DADC.7070909@linux.intel.com \
    --to=josh@linux.intel.com \
    --cc=bitbake-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.