* [PATCH] parse/ast: Expand inherit statements before splitting them
@ 2012-03-04 4:17 Richard Purdie
2012-03-07 22:13 ` McClintock Matthew-B29882
0 siblings, 1 reply; 3+ messages in thread
From: Richard Purdie @ 2012-03-04 4:17 UTC (permalink / raw)
To: bitbake-devel
This means that statements that expand to more then one entry
such as:
CLASSES = "a b"
inherit ${CLASSES}
work correctly instead of trying to inherit a class called "a b".
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
bitbake/lib/bb/cooker.py | 2 +-
bitbake/lib/bb/parse/ast.py | 4 ++--
bitbake/lib/bb/parse/parse_py/BBHandler.py | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 558eadd..d6e1bf8 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -1431,7 +1431,7 @@ def _parse(fn, data, include=True):
@catch_parse_error
def _inherit(bbclass, data):
- bb.parse.BBHandler.inherit([bbclass], "configuration INHERITs", 0, data)
+ bb.parse.BBHandler.inherit(bbclass, "configuration INHERITs", 0, data)
return data
class ParsingFailure(Exception):
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py
index 7cef3d0..eae840f 100644
--- a/bitbake/lib/bb/parse/ast.py
+++ b/bitbake/lib/bb/parse/ast.py
@@ -304,7 +304,7 @@ def handleBBHandlers(statements, filename, lineno, m):
def handleInherit(statements, filename, lineno, m):
classes = m.group(1)
- statements.append(InheritNode(filename, lineno, classes.split()))
+ statements.append(InheritNode(filename, lineno, classes))
def finalize(fn, d, variant = None):
all_handlers = {}
@@ -452,7 +452,7 @@ def multi_finalize(fn, d):
d.setVar("BBEXTENDVARIANT", variantmap[name])
else:
d.setVar("PN", "%s-%s" % (pn, name))
- bb.parse.BBHandler.inherit([extendedmap[name]], fn, 0, d)
+ bb.parse.BBHandler.inherit(extendedmap[name], fn, 0, d)
safe_d.setVar("BBCLASSEXTEND", extended)
_create_variants(datastores, extendedmap.keys(), extendfunc)
diff --git a/bitbake/lib/bb/parse/parse_py/BBHandler.py b/bitbake/lib/bb/parse/parse_py/BBHandler.py
index 125f458..815bce1 100644
--- a/bitbake/lib/bb/parse/parse_py/BBHandler.py
+++ b/bitbake/lib/bb/parse/parse_py/BBHandler.py
@@ -70,8 +70,8 @@ def supports(fn, d):
def inherit(files, fn, lineno, d):
__inherit_cache = data.getVar('__inherit_cache', d) or []
+ files = d.expand(files).split()
for file in files:
- file = data.expand(file, d)
if not os.path.isabs(file) and not file.endswith(".bbclass"):
file = os.path.join('classes', '%s.bbclass' % file)
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] parse/ast: Expand inherit statements before splitting them
2012-03-04 4:17 [PATCH] parse/ast: Expand inherit statements before splitting them Richard Purdie
@ 2012-03-07 22:13 ` McClintock Matthew-B29882
2012-03-08 15:01 ` Richard Purdie
0 siblings, 1 reply; 3+ messages in thread
From: McClintock Matthew-B29882 @ 2012-03-07 22:13 UTC (permalink / raw)
To: Richard Purdie; +Cc: bitbake-devel
On Sat, Mar 3, 2012 at 10:17 PM, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> This means that statements that expand to more then one entry
> such as:
>
> CLASSES = "a b"
> inherit ${CLASSES}
>
> work correctly instead of trying to inherit a class called "a b".
Does this effect:
CLASSES = ""
inherit a ${CLASSES}
?
-M
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] parse/ast: Expand inherit statements before splitting them
2012-03-07 22:13 ` McClintock Matthew-B29882
@ 2012-03-08 15:01 ` Richard Purdie
0 siblings, 0 replies; 3+ messages in thread
From: Richard Purdie @ 2012-03-08 15:01 UTC (permalink / raw)
To: McClintock Matthew-B29882; +Cc: bitbake-devel
On Wed, 2012-03-07 at 22:13 +0000, McClintock Matthew-B29882 wrote:
> On Sat, Mar 3, 2012 at 10:17 PM, Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
> > This means that statements that expand to more then one entry
> > such as:
> >
> > CLASSES = "a b"
> > inherit ${CLASSES}
> >
> > work correctly instead of trying to inherit a class called "a b".
>
> Does this effect:
>
> CLASSES = ""
>
> inherit a ${CLASSES}
Possibly in that if it didn't work before, it perhaps does now. I
certainly can't see the change making this any less functional.
Cheers,
Richard
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-03-08 15:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-04 4:17 [PATCH] parse/ast: Expand inherit statements before splitting them Richard Purdie
2012-03-07 22:13 ` McClintock Matthew-B29882
2012-03-08 15:01 ` Richard Purdie
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.