* [PATCH 1/2] base: improve PACKAGECONFIG handling logic
@ 2013-09-10 17:15 Ross Burton
2013-09-10 17:17 ` Burton, Ross
0 siblings, 1 reply; 6+ messages in thread
From: Ross Burton @ 2013-09-10 17:15 UTC (permalink / raw)
To: openembedded-core
The existing code for handling PACKAGECONFIG lists wasn't the cleanest Python
around. Instead of diving into the list directly using indices and lengths, use
pop() to iterate through the list.
Signed-off-by: Ross Burton <ross.burton@intel.com>
---
meta/classes/base.bbclass | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index dfa580c..12c8741 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -420,7 +420,7 @@ python () {
def appendVar(varname, appends):
if not appends:
return
- if varname.find("DEPENDS") != -1:
+ if "DEPENDS_" in varname:
if pn.startswith("nativesdk-"):
appends = expandFilter(appends, "", "nativesdk-")
if pn.endswith("-native"):
@@ -442,12 +442,15 @@ python () {
bb.error("Only enable,disable,depend,rdepend can be specified!")
if flag in pkgconfig:
- if num >= 3 and items[2]:
- extradeps.append(items[2])
- if num >= 4 and items[3]:
- extrardeps.append(items[3])
- if num >= 1 and items[0]:
- extraconf.append(items[0])
+ if items:
+ extraconf.append(items.pop(0))
+ # Skip over disable
+ if items:
+ items.pop(0)
+ if items:
+ extradeps.append(items.pop(0))
+ if items:
+ extrardeps.append(items.pop(0))
elif num >= 2 and items[1]:
extraconf.append(items[1])
appendVar('DEPENDS', extradeps)
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] base: improve PACKAGECONFIG handling logic
2013-09-10 17:15 Ross Burton
@ 2013-09-10 17:17 ` Burton, Ross
2013-09-10 18:49 ` Martin Jansa
0 siblings, 1 reply; 6+ messages in thread
From: Burton, Ross @ 2013-09-10 17:17 UTC (permalink / raw)
To: OE-core
On 10 September 2013 18:15, Ross Burton <ross.burton@intel.com> wrote:
> - if num >= 3 and items[2]:
> - extradeps.append(items[2])
> - if num >= 4 and items[3]:
> - extrardeps.append(items[3])
> - if num >= 1 and items[0]:
> - extraconf.append(items[0])
> + if items:
> + extraconf.append(items.pop(0))
> + # Skip over disable
> + if items:
> + items.pop(0)
> + if items:
> + extradeps.append(items.pop(0))
> + if items:
> + extrardeps.append(items.pop(0))
I should note that in a PACKAGECONFIG[foo] such as ",,,foo" this will
add some whitespace to EXTRA_OECONF and DEPENDS. If this is a massive
concern I can sort it, but the clear code trumps the odd extra
whitespace in my mind.
Ross
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] base: improve PACKAGECONFIG handling logic
2013-09-10 17:17 ` Burton, Ross
@ 2013-09-10 18:49 ` Martin Jansa
0 siblings, 0 replies; 6+ messages in thread
From: Martin Jansa @ 2013-09-10 18:49 UTC (permalink / raw)
To: Burton, Ross; +Cc: OE-core
[-- Attachment #1: Type: text/plain, Size: 1469 bytes --]
On Tue, Sep 10, 2013 at 06:17:27PM +0100, Burton, Ross wrote:
> On 10 September 2013 18:15, Ross Burton <ross.burton@intel.com> wrote:
> > - if num >= 3 and items[2]:
> > - extradeps.append(items[2])
> > - if num >= 4 and items[3]:
> > - extrardeps.append(items[3])
> > - if num >= 1 and items[0]:
> > - extraconf.append(items[0])
> > + if items:
> > + extraconf.append(items.pop(0))
> > + # Skip over disable
> > + if items:
> > + items.pop(0)
> > + if items:
> > + extradeps.append(items.pop(0))
> > + if items:
> > + extrardeps.append(items.pop(0))
>
> I should note that in a PACKAGECONFIG[foo] such as ",,,foo" this will
> add some whitespace to EXTRA_OECONF and DEPENDS. If this is a massive
> concern I can sort it, but the clear code trumps the odd extra
> whitespace in my mind.
EXTRA_OECONF/DEPENDS space will probably force do_compile/do_install
tasks to execute again, while RDEPENDS/RRECOMMENDS only PACKAGECONFIGs
could be enabled with only do_package re-executed.
I don't know how many PACKAGECONFIG options we have without first 3
parameters, but in your example with foo it would be significant change.
--
Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] base: improve PACKAGECONFIG handling logic
@ 2013-09-11 18:17 Ross Burton
2013-09-11 18:17 ` [PATCH 2/2] base: add RRECOMMENDS to PACKAGECONFIG Ross Burton
2013-09-12 3:30 ` [PATCH 1/2] base: improve PACKAGECONFIG handling logic Saul Wold
0 siblings, 2 replies; 6+ messages in thread
From: Ross Burton @ 2013-09-11 18:17 UTC (permalink / raw)
To: openembedded-core
The existing code for handling PACKAGECONFIG lists wasn't the cleanest Python
around. Instead of diving into the list directly using indices and lengths, use
pop() to iterate through the list.
Signed-off-by: Ross Burton <ross.burton@intel.com>
---
meta/classes/base.bbclass | 23 ++++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index dfa580c..37dc790 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -420,7 +420,7 @@ python () {
def appendVar(varname, appends):
if not appends:
return
- if varname.find("DEPENDS") != -1:
+ if "DEPENDS_" in varname:
if pn.startswith("nativesdk-"):
appends = expandFilter(appends, "", "nativesdk-")
if pn.endswith("-native"):
@@ -442,12 +442,21 @@ python () {
bb.error("Only enable,disable,depend,rdepend can be specified!")
if flag in pkgconfig:
- if num >= 3 and items[2]:
- extradeps.append(items[2])
- if num >= 4 and items[3]:
- extrardeps.append(items[3])
- if num >= 1 and items[0]:
- extraconf.append(items[0])
+ if items:
+ item = items.pop(0)
+ if item:
+ extraconf.append(item)
+ # Skip over disable
+ if items:
+ items.pop(0)
+ if items:
+ item = items.pop(0)
+ if item:
+ extradeps.append(item)
+ if items:
+ item = items.pop(0)
+ if item:
+ extrardeps.append(item)
elif num >= 2 and items[1]:
extraconf.append(items[1])
appendVar('DEPENDS', extradeps)
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] base: add RRECOMMENDS to PACKAGECONFIG
2013-09-11 18:17 [PATCH 1/2] base: improve PACKAGECONFIG handling logic Ross Burton
@ 2013-09-11 18:17 ` Ross Burton
2013-09-12 3:30 ` [PATCH 1/2] base: improve PACKAGECONFIG handling logic Saul Wold
1 sibling, 0 replies; 6+ messages in thread
From: Ross Burton @ 2013-09-11 18:17 UTC (permalink / raw)
To: openembedded-core
Add a fifth optional element of the PACKAGECONFIG flags that can be used to set
RRECOMMENDS_${PN}.
Signed-off-by: Ross Burton <ross.burton@intel.com>
---
meta/classes/base.bbclass | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 37dc790..924c45b 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -394,7 +394,7 @@ python () {
# These take the form:
#
# PACKAGECONFIG ??= "<default options>"
- # PACKAGECONFIG[foo] = "--enable-foo,--disable-foo,foo_depends,foo_runtime_depends"
+ # PACKAGECONFIG[foo] = "--enable-foo,--disable-foo,foo_depends,foo_runtime_depends,foo_runtime_recommends"
pkgconfigflags = d.getVarFlags("PACKAGECONFIG") or {}
if pkgconfigflags:
pkgconfig = (d.getVar('PACKAGECONFIG', True) or "").split()
@@ -420,7 +420,7 @@ python () {
def appendVar(varname, appends):
if not appends:
return
- if "DEPENDS_" in varname:
+ if "DEPENDS_" in varname or "RRECOMMENDS_" in varname:
if pn.startswith("nativesdk-"):
appends = expandFilter(appends, "", "nativesdk-")
if pn.endswith("-native"):
@@ -432,14 +432,15 @@ python () {
extradeps = []
extrardeps = []
+ extrarrecs = []
extraconf = []
for flag, flagval in pkgconfigflags.items():
if flag == "defaultval":
continue
items = flagval.split(",")
num = len(items)
- if num > 4:
- bb.error("Only enable,disable,depend,rdepend can be specified!")
+ if num > 5:
+ bb.error("Only enable,disable,depend,rdepend,rrecommend can be specified!")
if flag in pkgconfig:
if items:
@@ -457,10 +458,15 @@ python () {
item = items.pop(0)
if item:
extrardeps.append(item)
+ if items:
+ item = items.pop(0)
+ if item:
+ extrarrecs.append(item)
elif num >= 2 and items[1]:
extraconf.append(items[1])
appendVar('DEPENDS', extradeps)
appendVar('RDEPENDS_${PN}', extrardeps)
+ appendVar('RRECOMMENDS_${PN}', extrarrecs)
if bb.data.inherits_class('cmake', d):
appendVar('EXTRA_OECMAKE', extraconf)
else:
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] base: improve PACKAGECONFIG handling logic
2013-09-11 18:17 [PATCH 1/2] base: improve PACKAGECONFIG handling logic Ross Burton
2013-09-11 18:17 ` [PATCH 2/2] base: add RRECOMMENDS to PACKAGECONFIG Ross Burton
@ 2013-09-12 3:30 ` Saul Wold
1 sibling, 0 replies; 6+ messages in thread
From: Saul Wold @ 2013-09-12 3:30 UTC (permalink / raw)
To: Ross Burton; +Cc: openembedded-core
On 09/11/2013 11:17 AM, Ross Burton wrote:
> The existing code for handling PACKAGECONFIG lists wasn't the cleanest Python
> around. Instead of diving into the list directly using indices and lengths, use
> pop() to iterate through the list.
>
I started to get some strange behaviour with building world,
specifically, rpm-native stopped building. You can test this by
cleaning beecrypt-native and then try to build rpm-native.
Sau!
> Signed-off-by: Ross Burton <ross.burton@intel.com>
> ---
> meta/classes/base.bbclass | 23 ++++++++++++++++-------
> 1 file changed, 16 insertions(+), 7 deletions(-)
>
> diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
> index dfa580c..37dc790 100644
> --- a/meta/classes/base.bbclass
> +++ b/meta/classes/base.bbclass
> @@ -420,7 +420,7 @@ python () {
> def appendVar(varname, appends):
> if not appends:
> return
> - if varname.find("DEPENDS") != -1:
> + if "DEPENDS_" in varname:
> if pn.startswith("nativesdk-"):
> appends = expandFilter(appends, "", "nativesdk-")
> if pn.endswith("-native"):
> @@ -442,12 +442,21 @@ python () {
> bb.error("Only enable,disable,depend,rdepend can be specified!")
>
> if flag in pkgconfig:
> - if num >= 3 and items[2]:
> - extradeps.append(items[2])
> - if num >= 4 and items[3]:
> - extrardeps.append(items[3])
> - if num >= 1 and items[0]:
> - extraconf.append(items[0])
> + if items:
> + item = items.pop(0)
> + if item:
> + extraconf.append(item)
> + # Skip over disable
> + if items:
> + items.pop(0)
> + if items:
> + item = items.pop(0)
> + if item:
> + extradeps.append(item)
> + if items:
> + item = items.pop(0)
> + if item:
> + extrardeps.append(item)
> elif num >= 2 and items[1]:
> extraconf.append(items[1])
> appendVar('DEPENDS', extradeps)
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-09-12 3:30 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-11 18:17 [PATCH 1/2] base: improve PACKAGECONFIG handling logic Ross Burton
2013-09-11 18:17 ` [PATCH 2/2] base: add RRECOMMENDS to PACKAGECONFIG Ross Burton
2013-09-12 3:30 ` [PATCH 1/2] base: improve PACKAGECONFIG handling logic Saul Wold
-- strict thread matches above, loose matches on Subject: below --
2013-09-10 17:15 Ross Burton
2013-09-10 17:17 ` Burton, Ross
2013-09-10 18:49 ` Martin Jansa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox