]> code.ossystems Code Review - openembedded-core.git/commit
license.bbclass: Sane Parsing of licenses
authorBeth Flanagan <elizabeth.flanagan@intel.com>
Wed, 25 May 2011 20:58:35 +0000 (13:58 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 27 May 2011 22:36:18 +0000 (23:36 +0100)
commit2a90a3a41978a5470962b315e007351b8e80820c
tree94a39f2a71f4569a52f3ae47c4fd7eaf7ebb8cb9
parent21613c7ccfa54874ead33c5ae0f1a160db163b37
license.bbclass: Sane Parsing of licenses

This is a first pass at sane license parsing, using python
abstract syntax trees.

A few notes on this since ast is not generally used. I massage
the LICENSE field to be more pythonesque and then create an ast.

I then dump the ast and using a LicenseVisitor class, recurse
through the tree, looking for licenses. I then copy and link.

It's cleaner, allows for easier addition of logic and while it
takes slightly more CPU, it's also slightly faster in initial
small scale tests.

It doesn't recognize the '+' or '*' modifiers to the licenses yet
nor does it know what to do with bitors (|), since I'm not even
sure what to do with them.

Signed-off-by: Beth Flanagan <elizabeth.flanagan@intel.com>
meta/classes/license.bbclass