Commit Graph

61 Commits

Author SHA1 Message Date
Richard Purdie da56e3df88 parse_py: Use absolute paths for FILE
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>
2012-01-30 16:16:11 +00:00
Richard Purdie 64327ba9ea bitbake: Correctly handle multiline comments including whitespace
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>
2011-08-31 19:38:22 +01:00
Richard Purdie c0f0a8ee0c bitbake/BBHandler: Improve handling of multiline comments and warn users of the change
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-22 21:45:28 +00:00
Yu Ke 9e3a92c04a BBHandler: remove bb.fetch referrence
BBHandler.py no longer use bb.fetch, so remove its import statement

Signed-off-by: Yu Ke <ke.yu@intel.com>
2011-01-10 20:20:24 +00:00
Chris Larson b127874ee6 parse: pass filename, lineno into the ast
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>
2011-01-10 13:24:03 +00:00
Bernhard Reutner-Fischer c9d4807662 BBHandler: use basename directly in handler()
(Bitbake rev: 739a8ce6ac688061afd55cd3c980d0e9e45c5930)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 15:00:15 +00:00
Bernhard Reutner-Fischer f565258368 BBHandler: use os.path in inherit()
(Bitbake rev: 5b85de2c71973ba490b95a5d9ab634635f395142)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:39 +00:00
Bernhard Reutner-Fischer b44100eafc BBHandler: simplify supports()
(Bitbake rev: 858d704d713d15bf97053eb1374758c74b0d8874)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:39 +00:00
Chris Larson ecc68fa4fb Switch bitbake internals to use logging directly rather than bb.msg
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>
2011-01-04 14:46:33 +00:00
Richard Purdie 13fdd4ae5d bitbake/BBHandler: Save python functions into the dictonary
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-31 12:08:51 +01:00
Chris Larson ecbd5ca720 3.0 prep
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:37 +01:00
Bernhard Reutner-Fischer c63278bf34 parser: fix harmless typo in variable name
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>
2010-07-02 15:41:36 +01:00
Chris Larson c3eae29efa Don't try to expand non-string values
(Bitbake rev: fe36a726b9f930bbd6fd758c0aee78559e95f02b)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:34 +01:00
Chris Larson 1180bab54e Apply some 2to3 transforms that don't cause issues in 2.6
(Bitbake rev: d39ab776e7ceaefc8361150151cf0892dcb70d9c)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:33 +01:00
Chris Larson 978b5c9466 Deprecate the usage of certain objects via certain modules
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>
2010-07-02 15:41:33 +01:00
Chris Larson 1c74fd768f Import fixups
(Bitbake rev: 4fa052f426e3205ebace713eaa22deddc0420e8a)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:32 +01:00
Chris Larson 7acc132cac Formatting cleanups
(Bitbake rev: 2caf134b43a44dad30af4fbe33033b3c58deee57)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:32 +01:00
Chris Larson c244243274 Implement BBVERSIONS
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>
2010-03-25 17:25:45 +00:00
Chris Larson 2f9e15afbe Fix issues with BBCLASSEXTEND set by anonymous python, and rename some 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>
2010-03-22 15:03:21 +00:00
Chris Larson d8b12d4eea Re-getVar BBCLASSEXTEND after finalise()
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>
2010-03-22 14:56:16 +00:00
Holger Freyther 7b57ad901a bitbake: [parser] Make resolve_file only resolve the path
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>
2010-02-15 17:07:55 +00:00
Holger Freyther 83ec5eaed4 bitbake: [parser] Cache parsed .inc and .bbclass files for a parse speedup
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>
2010-02-15 17:07:54 +00:00
Holger Freyther c011d42eda bitbake: [parser] prepare to cache some .bbcclass and .inc files
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>
2010-02-15 17:07:53 +00:00
Holger Freyther 793c88dd92 bitbake: [parser] Remove the "data" from feeder, evaluate after parsing a file
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>
2010-02-15 17:07:51 +00:00
Chris Larson 3eb2e6cf02 bitbake: [parse] Move vars_from_file from bb.parse.BBHandler into bb.parse.
(Bitbake rev: fda0707d772e0964a0185d4ec4d016522f6972f3)

Signed-off-by: Chris Larson <clarson@mvista.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-15 17:07:50 +00:00
Holger Freyther df8f7706a6 bitbake: [parser] Add documentation about usage of this code
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-15 17:06:59 +00:00
Holger Freyther 4320386deb bitbake: [parser] Move the finalise into the ast as well
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-15 17:06:55 +00:00
Holger Freyther 4b25b519ae bitbake: [parser] Cary a Statement Node through the parsing
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>
2010-02-15 17:06:50 +00:00
Holger Freyther 5bac3403d7 bitbake: [parser] Move evaluating into the ast class...
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-15 17:06:36 +00:00
Khem Raj 99b4b10dc1 bitbake: BBHandler: pass lineno and fn to handleMethod
* 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>
2010-02-10 16:43:06 +00:00
Holger Freyther b045ab3222 bitbake: [parse] Move inherit handling to method
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-10 16:32:28 +00:00
Holger Freyther 7477c0d89a bitbake: [parsers] Move out more functions
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-10 16:32:14 +00:00
Holger Freyther e3c9a340dc bitbake: [parser] Move more stuff out to separate methods...
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-10 16:32:00 +00:00
Holger Freyther 169e719456 bitbake: [parser] Move the handling of a method to a function
We want to convert this into a proper AST. So move all
such operations to methods... Later change them to generate
a node... and create that node from here.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-10 16:31:48 +00:00
Holger Freyther 913e78898e bitbake: [parse] Unify opening a file...
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-10 16:31:33 +00:00
Holger Freyther 242a03607d bitbake: [parser] Kill obtain/localpath from the parser
With obtain it was possible to use an existing fetcher to
download a bb or config file. In practive no one has used it
and it was likely broken in regard to depends_cache... Remove
it for now, simplfiy the code.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-10 16:31:19 +00:00
Richard Purdie 22c29d8651 bitbake: Switch to bitbake-dev version (bitbake master upstream)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-20 18:46:02 +00:00
Richard Purdie dbd66fc808 bitbake/BBHandler: Only add do_ prefix to tasks if its not already present
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-18 11:41:44 +00:00
Richard Purdie 483f85802a bitbake: Sync various functions with those from bitbake-dev and bitbake upstream
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:21 +00:00
Richard Purdie 7642529554 bitbake: Anonymous funciton improvements - use methodpool to allow cached code and remove anonymous function indentation mismatch problems
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-10-13 08:38:13 +01:00
Richard Purdie 74016daa3a bitbake: Remove unused and hence pointless internal__functions__ variable
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-10-13 08:38:13 +01:00
Richard Purdie 107a9da006 bitbake: Merge further fixes from upstream 1.8 branch
* Make the test functionality work
* Optimise BBPATH handling when changing directory
* Optimise file globing for BBFILES

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-05-11 22:41:17 +01:00
Richard Purdie ade351e2f4 bitbake: Add in code to support the BBCLASSEXTEND variable. Virtual native/sdk recipes then become possible 2009-01-03 16:25:20 +00:00
Richard Purdie 250b021154 bitbake/BBHandler.py: Move handler finalisation code into a separate function 2009-01-02 23:49:18 +00:00
Richard Purdie b6b37f065c bitbake: Improve error message for missing class files 2008-11-06 00:12:31 +00:00
Richard Purdie 31511eb978 bitbake parse/__init_.py: Add missing update_mtime function fixing bitbake shell reparse failures
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@5196 311d38ba-8fff-0310-9ca6-ca027cbcb966
2008-09-16 19:14:49 +00:00
Marcin Juszkiewicz 822ea0e698 bitbake: apply r1075 from upstream to get postinsts working again
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4625 311d38ba-8fff-0310-9ca6-ca027cbcb966
2008-06-12 10:37:02 +00:00
Richard Purdie f1e89b2bb9 bitbake: Sync with upstream
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4504 311d38ba-8fff-0310-9ca6-ca027cbcb966
2008-05-19 20:41:58 +00:00
Richard Purdie ab191d21e2 bitbake: Update to bitbake 1.8 branch head
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@3892 311d38ba-8fff-0310-9ca6-ca027cbcb966
2008-03-03 22:01:45 +00:00
Richard Purdie e223238b1b bitbake: Update to latest bitbake-1.8 branch
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2651 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-09-02 14:10:08 +00:00