* [PATCH] base.bbclass: Don't warn about "invalid" PACKAGECONFIGs by default
@ 2015-07-30 9:43 Olof Johansson
2015-07-30 9:53 ` Burton, Ross
2015-07-30 10:08 ` Robert Yang
0 siblings, 2 replies; 6+ messages in thread
From: Olof Johansson @ 2015-07-30 9:43 UTC (permalink / raw)
To: openembedded-core
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)
--
2.1.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] base.bbclass: Don't warn about "invalid" PACKAGECONFIGs by default
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
1 sibling, 1 reply; 6+ messages in thread
From: Burton, Ross @ 2015-07-30 9:53 UTC (permalink / raw)
To: Olof Johansson; +Cc: OE-core
[-- Attachment #1: Type: text/plain, Size: 392 bytes --]
On 30 July 2015 at 10:43, Olof Johansson <olof.johansson@axis.com> 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.
>
Can you elaborate on what this approach you refer to is?
Ross
[-- Attachment #2: Type: text/html, Size: 807 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] base.bbclass: Don't warn about "invalid" PACKAGECONFIGs by default
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:08 ` Robert Yang
2015-07-30 11:24 ` Olof Johansson
1 sibling, 1 reply; 6+ messages in thread
From: Robert Yang @ 2015-07-30 10:08 UTC (permalink / raw)
To: Olof Johansson, openembedded-core
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)
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] base.bbclass: Don't warn about "invalid" PACKAGECONFIGs by default
2015-07-30 9:53 ` Burton, Ross
@ 2015-07-30 10:14 ` Olof Johansson
0 siblings, 0 replies; 6+ messages in thread
From: Olof Johansson @ 2015-07-30 10:14 UTC (permalink / raw)
To: Burton, Ross; +Cc: OE-core
Excerpts from Burton, Ross's message of 2015-07-30 11:53:39 +0200:
> Can you elaborate on what this approach you refer to is?
For some of our internal recipes, we export a list of PACKAGECONFIGs regardless
of their use in the recipe. This is to make sure the list is synchronized over
all the affected recipes.
--
olof johansson
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] base.bbclass: Don't warn about "invalid" PACKAGECONFIGs by default
2015-07-30 10:08 ` Robert Yang
@ 2015-07-30 11:24 ` Olof Johansson
2015-07-30 15:21 ` Robert Yang
0 siblings, 1 reply; 6+ messages in thread
From: Olof Johansson @ 2015-07-30 11:24 UTC (permalink / raw)
To: Robert Yang; +Cc: openembedded-core
Excerpts from Robert Yang's message of 2015-07-30 12:08:37 +0200:
> 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.
Thanks, such a patch would work nicely with my use case!
--
olof johansson
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] base.bbclass: Don't warn about "invalid" PACKAGECONFIGs by default
2015-07-30 11:24 ` Olof Johansson
@ 2015-07-30 15:21 ` Robert Yang
0 siblings, 0 replies; 6+ messages in thread
From: Robert Yang @ 2015-07-30 15:21 UTC (permalink / raw)
To: Olof Johansson; +Cc: openembedded-core
On 07/30/2015 07:24 PM, Olof Johansson wrote:
> Excerpts from Robert Yang's message of 2015-07-30 12:08:37 +0200:
>> 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.
>
> Thanks, such a patch would work nicely with my use case!
You're welcome, sent:
http://lists.openembedded.org/pipermail/openembedded-core/2015-July/108119.html
// Robert
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-07-30 15:21 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2015-07-30 11:24 ` Olof Johansson
2015-07-30 15:21 ` Robert Yang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox