summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/parse/ast.py
Commit message (Collapse)AuthorAgeFilesLines
* bitbake: ast: Store anonymous python function contents in the datstoreRichard Purdie2012-08-231-0/+1
| | | | | | | | | This is useful if we need to disable part of one during a backtrace for debugging purposes. (Bitbake rev: 80a0c1b06a30a6ba9977c29fac0437a208d8cbbc) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: ast: Extract text variable in PythonMethodNodeRichard Purdie2012-08-231-2/+3
| | | | | | (Bitbake rev: 2e98f740b4a57a3467b1a00b1ebc1aaee33a8ff0) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: ast: Rename PythonMethodNode define variable to modulenameRichard Purdie2012-08-231-6/+6
| | | | | | | | | It was hard for me to understand what the define variable was, modulename is hopefully a bit better. (Bitbake rev: 79f9f46319de85f85613ebe248c327f5852225ba) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: methodpool: Clean up the parsed module list handling to be slightly ↵Richard Purdie2012-08-231-1/+0
| | | | | | | | | | | | less insane This removes some dubious functions and replaces them with a simpler, cleaner API which better describes what the code is doing. Unused code/variables are removed and comments tweaked. (Bitbake rev: f1e943aebfb84e98253f3f21646d6765c4fa1d66) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: event/ast: Use better_exec instead of simple_execRichard Purdie2012-08-221-1/+1
| | | | | | | | | | | | This improves the stacktraces dumped by bitbake when for example anonymous python functions fail. Also default to passing code strings to better_exec to match the behaviour of simple_exec to aid the transition. (Bitbake rev: 7e8205929ae953731a6854ea80b197847cff5771) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake: Warn upon finding tab indentation in python functionsRichard Purdie2012-07-191-2/+2
| | | | | | | | | | | | Mixed spacing in python functions can cause subtle issues and generally confuses users. We've standardised on 4 space indentation, adding this warning helps ensure consistency and avoid bugs. It also makes _prepend and _append operations on python functions slightly less risky. (Bitbake rev: c51cfaf48d3b12a19b01e824b6ba4230376bcad4) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* parse/ast: Expand inherit statements before splitting themRichard Purdie2012-03-151-2/+2
| | | | | | | | | | | | | | 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". (Bitbake rev: 2568e9ace6e6f483e1bf2a9ef2f4d8318d6c85b7) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: Added BBINCLUDED variable.Lianhao Lu2012-02-281-0/+2
| | | | | | | | | | | Added new variable BBINCLUDED indicating the file dependency information. It exposes the internal variable '__base_depends' and '__depends'. (Bitbake rev: af524a656fce32d01687481b86c31bef00eb9fc3) Signed-off-by: Lianhao Lu <lianhao.lu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: add file and line number to ParseErrorPaul Eggleton2012-02-231-4/+4
| | | | | | | | | | | Ensure that a file and line number are reported for ParseError where possible. This helps particularly in the case of inherit and require which previously did not report either of these upon failure. (Bitbake rev: f588ba69622a2df35417ced184e56c79ac1b40d5) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: Update users of getVar/setVar to use the data store functions directlyRichard Purdie2011-11-271-50/+50
| | | | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake/ast: include class name when arguments given in variantPaul Eggleton2011-07-251-6/+8
| | | | | | | | | | | For multilib this produces variants of e.g. "multilib:lib64" instead of just "lib64"; however we set BBEXTENDVARIANT to "lib64" and the latter will be used when composing filenames for multilib. (Bitbake rev: de7a2b91512bb3ab058f5eb5cd188acd2b8a2220) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake/ast: Fix ??= vs. ?= handlingRichard Purdie2011-07-051-2/+2
| | | | | | | | | | As the code stands, setting a variable with ??= could result in a ?= variable not overriding it. This patch fixes the issue by allowing the ast to make lookups that ignore any ??= set variables. (Bitbake rev: 32fee2e650dfdd3aa9a7572dad1251e0c24ca34b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake/ast: Add optional argument for BBCLASSEXTENDRichard Purdie2011-06-281-3/+21
| | | | | | | | | | | | | Add an optional argument to BBCLASSEXTEND entries which gets passed to the extention class as BBEXTENDVARIANT. Also add BBEXTENDCURR whic is set to the current extension class name. This mode functions slightly differently to the previous BBCLASSEXTEND code in that PN is not changed. (Bitbake rev: 8d3c899e0a15840c54de26d2f1fc552430517778) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake/ast: Call expandkeys after the RecipePreFinalise eventRichard Purdie2011-06-281-2/+1
| | | | | | | | | This means the event handler can change variables such as PN and those changes will be reflected in the updated variable key names. (Bitbake rev: 664b85742d1afc94b291a85fd245abebffacdf3d) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake/event/ast: Add RecipePreFinalise eventRichard Purdie2011-06-091-6/+9
| | | | | | | | | | One of the implications is we need to register the event handlers before executing the anonymous python functions. I can't find any issue with making that change in any existing metadata use cases. (Bitbake rev: a981df3cc9bf410d24f39919959952bdc6c76d03) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake/parse/ast: We always need to finalize the default data since ↵Richard Purdie2011-06-091-2/+1
| | | | | | | | otherwise overrides to BBCLASSEXTEND may not be applied (Bitbake rev: f22ac9149cc9ab96510bb377deb82cd9bceb95c1) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* track skipped packagesPaul Eggleton2011-06-091-6/+6
| | | | | | | | | | | | | Add skiplist to cooker that allows access to the list of packages skipped via SkipPackage (this includes COMPATIBLE_MACHINE, INCOMPATIBLE_LICENSE, etc.) This can be used to enhance error reporting. (From Poky rev: 6c12b7b1099c77b87d4431d55e949cf7c5f52ded) (Bitbake rev: 7d2363f35350be27a33f568c23eb07fcd3d27e53) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* parse: pass a useful (if mangled) key to bb.data.expand for :=Chris Larson2011-06-071-1/+1
| | | | | | | (Bitbake rev: 8e1be0ca414d9d26e013ae212abdd9c39fa8df26) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake/ast.py: Only run finalise() for the specified variantRichard Purdie2011-05-051-2/+6
| | | | | | | Allows the heavy finalise function to only be run for the case we're interested in when running tasks, saving some processing time. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake/data_smart: Improve the way lazyassignment worksRichard Purdie2011-02-231-8/+0
| | | | | | | | | | | | | | | | | | | | Currently, if a variable has been set with ??= and the code looks it up before the data finalisation phase, no value is found. This is causes serious problems for anonymous python functions which manipulate data, or for the fetcher revision handling code where revisions can be set with ??=. There is also a significant performance implication for processing lazy assignment in finalise. Moving the check for a default value into getVarFlag addresses both the timing issue and the performace. This change gives a 7% real time performance improvement to parsing the Poky metadata. The cost of the check at this point is minimal since we have all the data flags available. This should also fix Yocto bug 752. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* parse: pass filename, lineno into the astChris Larson2011-01-101-49/+56
| | | | | | | | | | | We will be needing this information to improve the tracebacks of python code from the metadata, as well as to give the user information about where variables were defined, so they know how it ended up the way it is. (Bitbake rev: 9615c538b894f71a2d1a0ba6b3f260db91e75786) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* parse.ast: drop __word__ regular expressionChris Larson2011-01-061-4/+3
| | | | | | | | | We can use the string split method for this instead. (Bitbake rev: aa9646717b3ee1006628246a7c495f601e62391c) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* parse.ast: avoid code duplication for inheritChris Larson2011-01-061-6/+5
| | | | | | | (Bitbake rev: 0b11a3d4eab84b372fd45b9537cf0327008daf8d) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* Switch bitbake internals to use logging directly rather than bb.msgChris Larson2011-01-041-4/+8
| | | | | | | | | | | | | | We use a custom Logger subclass for our loggers This logger provides: - 'debug' method which accepts a debug level - 'plain' method which bypasses log formatting - 'verbose' method which is more detail than info, but less than debug (Bitbake rev: 3b2c1fe5ca56daebb24073a9dd45723d3efd2a8d) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* bitbake: Implement signaturesRichard Purdie2010-09-031-3/+3
| | | | | | Includes functionality to find out what changes between two different singature data dumps. Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* bitbake/ast: Ensure function definitions are always added to the dictonaryRichard Purdie2010-09-031-4/+4
| | | | Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* bitbake/data.py: Add emit_func() and generate_dependencies() functionsRichard Purdie2010-08-311-0/+2
| | | | | | | | These functions allow generation of dependency data between funcitons and variables allowing moves to be made towards generating checksums and allowing use of the dependency information in other parts of bitbake. Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* bitbake/BBHandler: Save python functions into the dictonaryRichard Purdie2010-08-311-3/+7
| | | | Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* bitbake: Add support for .bbappend files (see mailing lists for detais)Richard Purdie2010-07-161-1/+5
| | | | Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* 3.0 prepChris Larson2010-07-021-0/+2
| | | | Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Apply some 2to3 refactoringsChris Larson2010-07-021-6/+7
| | | | Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Kill the unnecessary setVarFlag debugging messageChris Larson2010-07-021-1/+0
| | | | | | | (Bitbake rev: ef8475796fbab4f76a72bbc106da4c35e3afe2e1) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Apply some 2to3 transforms that don't cause issues in 2.6Chris Larson2010-07-021-1/+1
| | | | | | | (Bitbake rev: d39ab776e7ceaefc8361150151cf0892dcb70d9c) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Import fixupsChris Larson2010-07-021-0/+1
| | | | | | | (Bitbake rev: 4fa052f426e3205ebace713eaa22deddc0420e8a) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Formatting cleanupsChris Larson2010-07-021-1/+1
| | | | | | | (Bitbake rev: 2caf134b43a44dad30af4fbe33033b3c58deee57) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Rename the finalise method for consistencyChris Larson2010-07-021-4/+4
| | | | | | | | | Apparently the finalise spelling is becoming less common in British English. (Bitbake rev: 47449b2fc433e5725839ca4f7e9bca931a475838) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Resurrect merged anonfunc executionChris Larson2010-07-021-4/+9
| | | | | | | (Bitbake rev: 0c2ed40277e157406ea25c858f14c3cebb73c21b) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Consolidate the exec/eval bits, switch anonfunc to better_exec, etcChris Larson2010-07-021-30/+6
| | | | | | | | | | | | The methodpool, ${@} expansions, anonymous python functions, event handlers now all run with the same global context, ensuring a consistent environment for them. Added a bb.utils.better_eval function which does an eval() with the same globals as better_exec. (Bitbake rev: 424d7e267b009cc19b8503eadab782736d9597d0) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Implement BBVERSIONSChris Larson2010-03-251-0/+114
| | | | | | | | | | | | | | | | | | | | | | | | This implements a feature similar to BBCLASSEXTEND, but for generating multiple versions of a given recipe. For example: BBVERSIONS = "1.0 2.0 git". In addition to the above, one can utilize [a-b] style patterns, and can have a :<basever> postfix, which allows you to essentially name the range of versions. Both the current version and the basever end up in OVERRIDES, and the basever gets placed into the BPV variable. The default BPV, if none is specified, is the original PV of the recipe, before bbversions processing. In this way, you can do things like: BBVERSIONS = "1.0.[0-6]:1.0.0+ 1.0.[7-9]:1.0.7+" SRC_URI_append_1.0.7+ = "file://some_extra_patch.patch;patch=1" Or you can create a recipe per range, and name the recipe file as such: nano_1.0.7+.bb. (Bitbake rev: 4ee9a56e16f1eb3c1649eaa3127b09ab0e93d1ec) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Implement ??= operatorChris Larson2010-03-221-0/+11
| | | | | | | | | | | | | | | | | ??= is a lazy, conditional assignment. Whereas a ?= immediately assigns to the variable if the variable has not yet been set, ??= does not apply the default assignment until the end of the parse. As a result, the final ??= for a given variable is used, as opposed to the first as in ?=. Note that the initial implementation relies upon finalise() to apply the defaults, so a "bitbake -e" without specifying a recipe will not show the defaults as set by ??=. Moving application of the default into getVar adds too large a performance hit. We may want to revisit this later. (Bitbake rev: 74f50fbca194c9c72bd2a540f4b9de458cb08e2d) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* bitbake: [parse] In ast, make StatementGroup inherit list, and add a AstNode ↵Chris Larson2010-02-151-22/+13
| | | | | | | | | base class. (Bitbake rev: 7ea31b2842b45ffe1ca688f55207f8676442a108) Signed-off-by: Chris Larson <clarson@mvista.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* bitbake: [parser] Remove the "data" from feeder, evaluate after parsing a fileHolger Freyther2010-02-151-31/+13
| | | | | | | | | Evaluate the statements after having parsed one file. This is referred to as "entwirren" and we can remove the direct evaluation and postpone a bit, in the future we can use a cached copy instead of parsing the original. Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* bitbake: [parse] Move the last method to the AST...Holger Freyther2010-02-151-1/+10
| | | | Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* bitbake: [parser] Move more methods to the ast schemeHolger Freyther2010-02-151-31/+48
| | | | Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* bitbake: [parser] Move one more item to the astHolger Freyther2010-02-151-34/+41
| | | | Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* bitbake: [parser] Move methodflags over to the astHolger Freyther2010-02-151-15/+23
| | | | Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* bitbake: [parser] Build fixRichard Purdie2010-02-151-2/+2
| | | | | | (Bitbake rev: 9c97696f37499b4d0ec5c034c51e4cf6bc425ba2) Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* bitbake: [parser] Move more statements over the two phase ASTHolger Freyther2010-02-151-17/+40
| | | | | | Create the data first, then evaluate on the data dict Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* bitbake: [parse] Change handling include through the AstNodeHolger Freyther2010-02-151-8/+2
| | | | | | | Disable the recursively evaluating the statement for now as it is causing problems. Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* bitbake: [parser] Call eval and remove non ast codeHolger Freyther2010-02-151-2/+1
| | | | Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>