summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/parse/parse_py
Commit message (Collapse)AuthorAgeFilesLines
* bitbake: methodpool: Clean up the parsed module list handling to be slightly ↵Richard Purdie2012-08-231-1/+1
| | | | | | | | | | | | 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>
* BBHandler: Tweak some data store access methods to the preferred syntaxRichard Purdie2012-05-251-4/+4
| | | | | | (Bitbake rev: d7ec0f90354e60c415a01429bf26746c1d63b7ad) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* ConfHandler.py: Add a hook for config parsingRichard Purdie2012-04-131-0/+11
| | | | | | | | | | | To make the UI settings take effect, we need to hook at the end of each config file parsing and set UI specific values. (Bitbake rev: f54e733c7863110896f43900d9e4e791602f9d65) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* parse/ast: Expand inherit statements before splitting themRichard Purdie2012-03-151-1/+1
| | | | | | | | | | | | | | 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>
* meta/classes: Convert to use appendVar and appendVarFlagsRichard Purdie2012-03-051-1/+1
| | | | | | (From OE-Core rev: 3b57de68e70e77dbc03c0616a83a29a2e99e40b4) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* parse/ConfHandler: Fix enthusiatic export regexp matchingRichard Purdie2012-02-291-1/+1
| | | | | | | | | | | | | | | | | | | | The export regexp was only meant to catch values like: export VARIABLENAME however after the stricter quoting patch was applied, it was also matching variables like: export BAR=foo and setting the export flag on a variable called "BAR=foo". The = character is an invalid variable name character. This patch tightens up the regexp match so it only matches the intended character set and only matches variable names. (Bitbake rev: 6d1765c2eac8c1958ceb9c81d55d04a9bc961cb1) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake/ConfHandler: Be more strict about variable quotingRichard Purdie2012-02-281-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, bitbake will accept variables in the forms: X = 1 X = '1 \ X = "1" X = '1' which will all set X=1. This patch removes the first two possibilities and makes quoting mandatory. There is little metadata out there which doesn't quote properly and bitbake will exit with an error about the exact line number and file with any problem so users can easily identify and fix issues. OE-Core has already been checked/fixed. The motivation for this is being able to give sane errors if a user does something like: IMAGE_INSTALL += # tslib mtd-utils" which currently gives a really nasty failure. (Bitbake rev: a8ae80741fea5e0ec0fb9a52a963a4baa38d2564) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: add file and line number to ParseErrorPaul Eggleton2012-02-232-9/+8
| | | | | | | | | | | 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-272-10/+10
| | | | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* parse_py: Use absolute paths for FILERichard Purdie2011-11-182-2/+2
| | | | | | | | | | | | Its possible for relative paths to creep into FILE. These confuse the build system no end as its not clear where they might be releative to. This patch ensures we always use resolved absolute paths for FILE so that things behave in a deterministic way. (Bitbake rev: 658d7daa70e46c2b20973b90ee53f0bbadc8bf5d) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* Fix typos in local.conf.sample and local.conf.sample.extendedRobert Yang2011-10-111-1/+0
| | | | | | | | | | | | | | | | Fixes bug [YOCTO #1667] Fix typos in local.conf.sample and local.conf.sample.extended: differernt -> different chages -> changes complation -> compilation egde -> edge "an an" -> "as an" images's -> image's Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: Correctly handle multiline comments including whitespaceRichard Purdie2011-08-311-6/+6
| | | | | | | | | | | | | | | | | | | | | | | If metadata contains: """ FOO = "bar" """ The variable FOO should get set to "bar" but doesn't due to the empty lines be swallowed by the parser and FOO becomming part of the multiline comment. This patch corrects that behaviour so FOO is set as expected. [YOCTO #1377] This patch fixes parsing of multiline comments so lines ending with \ behave consistently and we warn users where there is something happening they likely don't expect. (Bitbake rev: 30eaef7f50fff855cf8830772a7088dd83a4240e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* parse/ConfHandler: Fix multiline variable corruptionRichard Purdie2011-07-211-1/+1
| | | | | | | | | | | | | | | When parsing multiline variables in conf files, the last character can be accidentally removed. s2 contains new data read from the file which may or may not end with the continuation character. It makes sense to let the next loop iteration strip this if needed. We don't often use multiline expressions in .conf files which is why I'd imagine we haven't noticed this before. Most variables are quoted and its the closing quotation which often disappears. (Bitbake rev: 09a9146262d58dfe4a2ea4270026b90ae33f6c91) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake/BBHandler: Improve handling of multiline comments and warn users of ↵Richard Purdie2011-02-221-2/+11
| | | | | | the change Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* BBHandler: remove bb.fetch referrenceYu Ke2011-01-101-1/+1
| | | | | | BBHandler.py no longer use bb.fetch, so remove its import statement Signed-off-by: Yu Ke <ke.yu@intel.com>
* parse: pass filename, lineno into the astChris Larson2011-01-102-11/+12
| | | | | | | | | | | 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>
* ConfHandler: commentary typo fixesBernhard Reutner-Fischer2011-01-041-3/+3
| | | | | | | (Bitbake rev: 089dc31932a85455ed0fec8209d0451af4310f94) Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* BBHandler: use basename directly in handler()Bernhard Reutner-Fischer2011-01-041-2/+2
| | | | | | | (Bitbake rev: 739a8ce6ac688061afd55cd3c980d0e9e45c5930) Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* BBHandler: use os.path in inherit()Bernhard Reutner-Fischer2011-01-041-1/+1
| | | | | | | (Bitbake rev: 5b85de2c71973ba490b95a5d9ab634635f395142) Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* BBHandler: simplify supports()Bernhard Reutner-Fischer2011-01-041-1/+2
| | | | | | | (Bitbake rev: 858d704d713d15bf97053eb1374758c74b0d8874) Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Switch bitbake internals to use logging directly rather than bb.msgChris Larson2011-01-042-6/+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/BBHandler: Save python functions into the dictonaryRichard Purdie2010-08-311-2/+3
| | | | Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* 3.0 prepChris Larson2010-07-022-7/+10
| | | | Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* parser: fix harmless typo in variable nameBernhard Reutner-Fischer2010-07-021-4/+4
| | | | | | | | | s/absolsute/absolute/ (Bitbake rev: 837c84ce47c298316b941a5f3d2479bd2643686b) Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Don't try to expand non-string valuesChris Larson2010-07-021-1/+1
| | | | | | | (Bitbake rev: fe36a726b9f930bbd6fd758c0aee78559e95f02b) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Move the unset BBPATH sanity check after the bblayers processingChris Larson2010-07-021-4/+1
| | | | | | | | | | This way we can fully utilize bblayers, you can do everything in bblayers.conf and avoid setting any environment variables at all. (Bitbake rev: 5def1c8c31432968349f9b29d6333d7962260a8b) 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-022-4/+4
| | | | | | | (Bitbake rev: d39ab776e7ceaefc8361150151cf0892dcb70d9c) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Deprecate the usage of certain objects via certain modulesChris Larson2010-07-021-1/+1
| | | | | | | | | | | | As an example, this displays a deprecation warning for the use of "bb.encodeurl" when you should be using "bb.fetch.encodeurl". It includes a convenience function for this purpose. It should be of use when moving objects between modules permanently, changing the API the user sees. (Bitbake rev: 78f56049ba863b2e585b89db12b32697eb879bbc) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Drop __all__ usageChris Larson2010-07-021-2/+0
| | | | | | | (Bitbake rev: b4983cc7bfe5300c1d2904f34fb03d4fb2f41d90) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Import fixupsChris Larson2010-07-022-4/+4
| | | | | | | (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-022-2/+2
| | | | | | | (Bitbake rev: 2caf134b43a44dad30af4fbe33033b3c58deee57) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Stop using functions via 'bb' that were moved from there to other modulesChris Larson2010-07-021-1/+2
| | | | | | | (Bitbake rev: 03a6c26f8da226f442c3cab557e4733f7cd6eeac) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Ensure we always utilize the correct messaging domainsChris Larson2010-07-021-1/+1
| | | | | | | (Bitbake rev: 92a2e2e90981c0615171abe03645a772d84f6986) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Implement BBVERSIONSChris Larson2010-03-251-24/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* Fix issues with BBCLASSEXTEND set by anonymous python, and rename some ↵Chris Larson2010-03-221-14/+16
| | | | | | | | | variables to improve code clarity (Bitbake rev: 3062e96181fe845cfd286990b0216888ddd3d228) Signed-off-by: Chris Larson <clarson@kergoth.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Implement ??= operatorChris Larson2010-03-221-1/+1
| | | | | | | | | | | | | | | | | ??= 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>
* Re-getVar BBCLASSEXTEND after finalise()Chris Larson2010-03-221-3/+2
| | | | | | | | | | This ensures that an anonymous python function is able to manipulate the BBCLASSEXTEND contents, and, therefore, amend.inc files are able to add to it. (Bitbake rev: c7d038d404afaf4ce3735af5134163759da6f6ef) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Error early if BBPATH is unset, rather than falling back to share/bitbakeChris Larson2010-03-221-5/+1
| | | | | | | | | | Better to error as early as possible rather than experience strange behavior resulting from the use of the largely useless stock bitbake.conf/base.bbclass. (Bitbake rev: 641e6cf3ec3ab4d26929cf4d2a3704ff07eed4d6) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* bitbake: [parser] Make resolve_file only resolve the pathHolger Freyther2010-02-152-4/+6
| | | | | | | | Do not attempt to open the file in the resolve_file method (a lot like bb.which... maybe bb.which can be used). This way we don't need to open/close a file which we have already parsed. Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* bitbake: [parser] Cache parsed .inc and .bbclass files for a parse speedupHolger Freyther2010-02-151-14/+23
| | | | | | | Have a growing dict with .inc and .bbclass'es. This avoids to reparse files we have already seen. Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* bitbake: [parser] prepare to cache some .bbcclass and .inc filesHolger Freyther2010-02-151-11/+18
| | | | | | | | | Our parser is shit but instead to replace it now we will see how long we can drive the wave by caching parsed files. This will not go through the feeder again but we can just reevaluate the StatementGroup. Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* bitbake: [parser] Remove the "data" from feeder, evaluate after parsing a fileHolger Freyther2010-02-152-27/+36
| | | | | | | | | 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 vars_from_file from bb.parse.BBHandler into bb.parse.Chris Larson2010-02-151-21/+3
| | | | | | | (Bitbake rev: fda0707d772e0964a0185d4ec4d016522f6972f3) Signed-off-by: Chris Larson <clarson@mvista.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* bitbake: [parser] Add documentation about usage of this codeHolger Freyther2010-02-151-0/+1
| | | | Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* bitbake: [parser] Move the finalise into the ast as wellHolger Freyther2010-02-151-43/+2
| | | | Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* bitbake: [parser] Cary a Statement Node through the parsingHolger Freyther2010-02-152-24/+25
| | | | | | | | | When parsing we will collect a number of statements that can be evaluated...The plan is to be evaluate things twice (old+new) and then compare the result, it should be the same. Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* bitbake: [parser] Move evaluating into the ast class...Holger Freyther2010-02-152-180/+16
| | | | Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* bitbake: BBHandler: pass lineno and fn to handleMethodKhem Raj2010-02-101-2/+2
| | | | | | | | | | | * lineno and fn are needed in handleMethod to restore the functionality as it was before. (Bitbake rev: ac6792045959cfee56279c1c4597521e990848e7) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Chris Larson <clarson@kergoth.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* bitbake: parse_py/ConfHandler.py: missing colon after elseMartin Jansa2010-02-101-1/+1
| | | | | | (Bitbake rev: d520ae0764016906ff61ec33b14eabc908aa8408) Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* bitbake: ConfHandler: Fix require vs. include behaviourRichard Purdie2010-02-101-1/+4
| | | | | | (Bitbake rev: 824a032672c8673cae28e492aa916a4750b94efa) Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>