Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Phil Blundell <pb@pbcl.net>
To: Otavio Salvador <otavio@ossystems.com.br>
Cc: OpenEmbedded Core Mailing List
	<openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH] base.bbclass: Add COMPATIBLE_DISTRO_FEATURES support
Date: Tue, 28 May 2013 16:12:18 +0100	[thread overview]
Message-ID: <1369753938.8846.8.camel@phil-desktop.brightsign> (raw)
In-Reply-To: <1369753475-22573-1-git-send-email-otavio@ossystems.com.br>

On Tue, 2013-05-28 at 12:04 -0300, Otavio Salvador wrote:
> This add support to list compatible distro feature for a recipe; this
> is important for example when you have two different recipes which
> should be choosen depending on the distro features set.

The terminology used here seems to be wrong/misleading/confusing:

> +        need_distro_features = d.getVar('COMPATIBLE_DISTRO_FEATURES', True)
> +        if need_distro_features:
> +            need_distro_features = need_distro_features.split()
> +            distro_features = (d.getVar('DISTRO_FEATURES', True) or "").split()
> +            for f in need_distro_features:
> +                if f in distro_features:
> +                    bb.note("here")
> +                    break
> +            else:
> +                raise bb.parse.SkipPackage("incompatible with distro features %s (not in DISTRO_FEATURES)" % need_distro_features)

Calling the variable "COMPATIBLE_DISTRO_FEATURES" implies that the
recipe won't work with any features not in the list.  But the actual
implementation shown above is that the recipe will be skipped unless all
of the features listed are present in DISTRO_FEATURES.  If those are the
intended semantics then it seems as though the variable ought to be
named REQUIRED_DISTRO_FEATURES or something.

Similarly, the error message "incompatible with distro features %s (not
in DISTRO_FEATURES)" is, at best, confusing.  This message seems to be
staying that the recipe won't work if the named features are set, but it
then goes on to say that they are not in fact set.  Plus, it lists the
entire contents of COMPATIBLE_DISTRO_FEATURES rather than just the items
that are causing a problem.

Also, you seem to have a spurious bb.note() call in there.

Also also, we've managed without this functionality in oe-core for some
time which makes me wonder how widely useful it would actually be.  If
it's only going to be used by a few recipes then it could go in a class,
or in in the recipes themselves, rather than adding parse time and
memory footprint to every recipe.

p.




  reply	other threads:[~2013-05-28 15:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-28 15:04 [PATCH] base.bbclass: Add COMPATIBLE_DISTRO_FEATURES support Otavio Salvador
2013-05-28 15:12 ` Phil Blundell [this message]
2013-05-28 15:18   ` Otavio Salvador
2013-05-28 15:21     ` Eric Bénard
2013-05-28 15:26       ` Otavio Salvador
2013-05-28 15:31     ` Phil Blundell
2013-05-28 16:08       ` Otavio Salvador
2013-05-28 16:28         ` Phil Blundell
2013-05-28 16:33           ` Otavio Salvador
2013-05-28 16:36             ` Phil Blundell
2013-05-28 16:39               ` Otavio Salvador

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=1369753938.8846.8.camel@phil-desktop.brightsign \
    --to=pb@pbcl.net \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=otavio@ossystems.com.br \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox