Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Robert Yang <liezhi.yang@windriver.com>
To: Olof Johansson <olof.johansson@axis.com>,
	<openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH] base.bbclass: Don't warn about "invalid" PACKAGECONFIGs by default
Date: Thu, 30 Jul 2015 18:08:37 +0800	[thread overview]
Message-ID: <55B9F7A5.3040100@windriver.com> (raw)
In-Reply-To: <1438249425-5423-1-git-send-email-olofjn@axis.com>


Hello,

I have a new patch for this, it will be moved into insane.bbclass,
and the recipe can set INSANE_SKIP:
+
+    # Check invalid PACKAGECONFIG
+    pkgconfig = (d.getVar("PACKAGECONFIG", True) or "").split()
+    if pkgconfig:
+        pkgconfigflags = d.getVarFlags("PACKAGECONFIG") or {}
+        for pconfig in pkgconfig:
+            if pconfig not in pkgconfigflags:
+                pn = d.getVar('PN', True)
+                error_msg = "%s: invalid PACKAGECONFIG: %s" % (pn, pconfig)
+                package_qa_handle_error("invalid-pkgconfig", error_msg, d)

I'm testing it, and will send it out sooner.

// Robert

On 07/30/2015 05:43 PM, Olof Johansson wrote:
> The recently added warnings for recipes that try to use undefined
> packageconfigs isn't compatible with the PACKAGECONFIG approach of
> exporting a common set of configs and letting the recipe look only at
> the configs they care about.
>
> This change introduces a STRICT_PACKAGECONFIG variable that one can
> enable to get the warnings.
>
> Signed-off-by: Olof Johansson <olofjn@axis.com>
> ---
>   meta/classes/base.bbclass | 9 ++++++---
>   1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
> index e0f1053..6f652d8 100644
> --- a/meta/classes/base.bbclass
> +++ b/meta/classes/base.bbclass
> @@ -340,9 +340,12 @@ python () {
>           pkgconfig = (d.getVar('PACKAGECONFIG', True) or "").split()
>           pn = d.getVar("PN", True)
>
> -        for pconfig in pkgconfig:
> -            if pconfig not in pkgconfigflags:
> -                bb.warn("%s: invalid PACKAGECONFIG: %s" % (pn, pconfig))
> +        # If STRICT_PACKAGECONFIG is set, warn about recipes that sets undefined
> +        # PACKAGECONFIGs.
> +        if bb.utils.to_boolean(d.getVar("STRICT_PACKAGECONFIG", True)):
> +            for pconfig in pkgconfig:
> +                if pconfig not in pkgconfigflags:
> +                    bb.warn("%s: invalid PACKAGECONFIG: %s" % (pn, pconfig))
>
>           mlprefix = d.getVar("MLPREFIX", True)
>
>


  parent reply	other threads:[~2015-07-30 10:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-30  9:43 [PATCH] base.bbclass: Don't warn about "invalid" PACKAGECONFIGs by default Olof Johansson
2015-07-30  9:53 ` Burton, Ross
2015-07-30 10:14   ` Olof Johansson
2015-07-30 10:08 ` Robert Yang [this message]
2015-07-30 11:24   ` Olof Johansson
2015-07-30 15:21     ` 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=55B9F7A5.3040100@windriver.com \
    --to=liezhi.yang@windriver.com \
    --cc=olof.johansson@axis.com \
    --cc=openembedded-core@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox