All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Eggleton <paul.eggleton@linux.intel.com>
To: Robert Yang <liezhi.yang@windriver.com>
Cc: yocto@yoctoproject.org
Subject: Re: [layerindex-web][PATCH 1/1] import_layer.py: add -t option for layer_type
Date: Tue, 24 Jul 2018 10:33:32 +0200	[thread overview]
Message-ID: <1703434.H6ZhUBsmPD@localhost.localdomain> (raw)
In-Reply-To: <a08dc8b5ece1f1d3db4c1dc7278a38c980d7302f.1532341697.git.liezhi.yang@windriver.com>

Hi Robert,

On Monday, 23 July 2018 12:30:01 PM CEST Robert Yang wrote:
> Now the logic is:
> Use options.layer_type if specified, guess if not, default to 'M'.
> 
> Note choices=['A', 'B', 'S', 'D', 'M', ''], the '' is for default='', we can't
> use default='M' here, otherwise we don't know whether the 'M' is specified by
> user or not, we don't guess if it is specified by user, otherwise, guess.
> 
> Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
> ---
>  layerindex/tools/import_layer.py | 18 +++++++++++++-----
>  1 file changed, 13 insertions(+), 5 deletions(-)
> 
> diff --git a/layerindex/tools/import_layer.py b/layerindex/tools/import_layer.py
> index 2413cff..0d501f6 100755
> --- a/layerindex/tools/import_layer.py
> +++ b/layerindex/tools/import_layer.py
> @@ -189,6 +189,10 @@ def main():
>      parser.add_option("-s", "--subdir",
>              help = "Specify subdirectory",
>              action="store", dest="subdir")
> +    parser.add_option("-t", "--type",
> +            help = "Specify layer type. A: Base, B: Machine(BSP), S: Software, D: Distribution, M: Miscellaneous",
> +            choices=['A', 'B', 'S', 'D', 'M', ''],
> +            action="store", dest="layer_type", default='')

If it's practical to do, could you make this part of the code use 
LayerItem.LAYER_TYPE_CHOICES from models.py so that this will work
if that is extended in future? Of course that will mean initialising Django
earlier, I'm not sure if that will have any side-effects that we wouldn't want.
If you could give that a try though that would be great.

Thanks,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre




  reply	other threads:[~2018-07-27  5:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-23 10:30 [layerindex-web][PATCH 0/1] import_layer.py: add -t option for layer_type Robert Yang
2018-07-23 10:30 ` [layerindex-web][PATCH 1/1] " Robert Yang
2018-07-24  8:33   ` Paul Eggleton [this message]
2018-07-31  7:57     ` Robert Yang
2018-08-30  2:05       ` Robert Yang
2018-08-30  6:20         ` Paul Eggleton
2018-08-30  6:39           ` Robert Yang

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=1703434.H6ZhUBsmPD@localhost.localdomain \
    --to=paul.eggleton@linux.intel.com \
    --cc=liezhi.yang@windriver.com \
    --cc=yocto@yoctoproject.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.