aboutsummaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/data.py
AgeCommit message (Collapse)Author
2012-07-19bitbake: bitbake: Warn upon finding tab indentation in python functionsRichard Purdie
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>
2012-05-30bitbake: include varflags in checksumsPaul Eggleton
Add a dependency to each variable on a filtered list of its varflags. This is intended to catch things such as SRC_URI checksums, varflags controlling extra functionality from classes (e.g. the recently updated update-alternatives class in OE-Core), etc. and ensure their values influence the sstate checksums. There is an exclusion list which needs to be set via bitbake.conf (BB_SIGNATURE_EXCLUDE_FLAGS), if this is not set then the functionality is disabled. The existing vardepsexclude mechanism can also be used to exclude undesired varflags, but they must be fully specified, e.g.: do_patch[vardepsexclude] += "do_patch[someflag]" Implements [YOCTO #2517]. (Bitbake rev: 56c1ab18fcaf4ac245dcb412ed55e8e0af07883b) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-27data/runqueue.py: Fix commented out test code after variable name changesRichard Purdie
(Bitbake rev: 175c5c8a5e51365aa127562e8598e84f5cd36495) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-27bitbake: Update users of getVar/setVar to use the data store functions directlyRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-24data/siggen: Add vardepvalue mechanism to allow the variable dependency code ↵Richard Purdie
to be forced to specific values We have a problem if we want to inject specific information into the variable dependency code. There are cases for example where we want a dependency on the value of X but it doesn't matter how X was constructed or what dependencies it might have had, we only care about the absolute value. With the current code, its near enough impossible to do this. This patch adds such a mechanism so the user can trigger this with code like: baselib[vardepvalue] = "${baselib}" It also refactors some of the code so we do variable lookups once instead of doing this in two different functions. [YOCTO #1583] (Bitbake rev: 6c879b44ccf42dc73fe4467076e114700d7ba81b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-10codeparser: silence non-literal warnings for vardepsChristopher Larson
If the vardeps flag is not None, we now silence the warnings about non-literal usage for that variable. (Bitbake rev: e724b9f417d1baf898f5afc6376c73c1a2ad8db9) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-10codeparser: accept a name for better messagesChristopher Larson
- If a name is passed to the parser, prepend the messages with "while parsing <name>:". This gives a bit more context. - Tweak the warning messages slightly (they had to be altered anyway to inject the variable being parsed). Before: DEBUG: Warning: in call to 'bb.data.getVar': argument ''%s' % var' is \ not a literal After: DEBUG: while parsing emit_pkgdata, in call of bb.data.getVar, argument \ ''%s' % var' is not a string literal (Bitbake rev: 1060193ae4d54e667735dbff5d1d2be49a3f95c9) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-15Ensure only the filtered environment variables are inherited from the OSJoshua Lock
The recent change which modified inheritFromOS to use the intial environment, rather than the current environment, introduced a bug such that variables which had been cleaned from the environment where still set in the data store. This patch changes things such that a list of approved environment variables is saved after the environment is cleaned and only the variables in this list are inherited in inheritFromOS. CC: James Limbouris <james.limbouris@gmail.com> CC: Chris Larson <clarson@kergoth.com> (Bitbake rev: cb6c07054e8baf94614713ec257c643b22266d75) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-26data|cooker: use saved environment variables when calling inheritFromOSJoshua Lock
Now that we have a pristine copy of the variables available at launch time we can use them when looking to inherit the OS's environment. (Bitbake rev: 21c21fcc5871e81d8d497b6baed605cdd74c4571) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-15make exception handling syntax consistentScott Garman
Update exception handling syntax to use the modern style: except ExcType as localvar (Bitbake rev: dbf5f42b06bef81749b13aa99945cc1292a6676d) Signed-off-by: Scott Garman <scott.a.garman@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-08bitbake/data/runqueue: Sync up with upstream to clean up environment ↵Richard Purdie
variable handling Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-12bitbake/siggen.py: Fix whitelisted variable handlingRichard Purdie
Even when a variable was whitelisted, any dependencies of that variable could still creep into the task hash due to the way the whitelisting code worked. This patch changes thing to ensure that when whitelisted, that whitelisting applies to the variable and any dependencies it has. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-10bitbake: Sync environment handling function names and comments with upstream ↵Richard Purdie
alterations Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-07bitbake/data.py: corrected the output for shell syntax.Lianhao Lu
[BUGID# 645], modify the emit_var() 1. Added "#" to the beginning of each line if the comment contains multiple lines. 2. Added "\" to the end of each line if the shell variable value contains multiple lines. Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
2011-01-04data: fewer newlines for (un)exportBernhard Reutner-Fischer
Previously we emitted two newlines for export and unexport. One newline for export and unexport is enough (and makes the scripts look better and a tad smaller). (Bitbake rev: ba060160fdf1278a273fb2b77d36b8c681807ecf) Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04bitbake: Sync a load of whitespace and other non-functionality changes with ↵Richard Purdie
bitbake uptream Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-12-14bitbake: add optional expansion to getVarFlag()Paul Eggleton
Add a parameter to getVarFlag() to auto-expand the value of the flag. This makes getVarFlag() more consistent with getVar(), and allows expansion of vardeps and vardepsexclude (which has been done in this commit). Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2010-12-14bitbake: allow excluding dependencies of variablesPaul Eggleton
Adds a vardepsexclude flag that can be used to exclude a dependency of a variable (the opposite of vardeps). This will allow the exclusion of variables from the hash generation much more selectively than blanket whitelisting using BB_HASHBASE_WHITELIST. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2010-12-09bitbake: Overhaul environment handlingRichard Purdie
Currently, anything whitelisted in the environment makes it into the worker processes. This is undesireable and the worker environment should be as clean as possible. This patch adapts bitbake sosme variables are loaded into bitbake's datastore but not exported by default. Any variable can be exported by setting its export flag. Currently, this code only finalises the environment in he worker as doing so in the server means variables are unavailable in the worker. If we switch back to fork() calls instead of exec() this code will need revisting. Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-09-13bitbake/data.py: Allow variables to suplement dependencies using the vardep flagRichard Purdie
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-31bitbake/data.py: Add emit_func() and generate_dependencies() functionsRichard Purdie
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>
2010-08-20bitbake/data.py: Handle exceptions in export_bars in the same way as emit_var()Richard Purdie
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-19bitbake: Switch to use subprocess for forking tasks and FAKEROOTENV to run ↵Richard Purdie
shell and python under a fakeroot environment Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02Don't emit vars starting with __, as those are internalChris Larson
(Bitbake rev: 211f44ce0e15c7c419606e9ef3568d9cea6775b7) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02Enhance the expansion exception messageChris Larson
(Bitbake rev: 1cc11164a85a5b30d6b9184cb5a8f7f7ac1aaff2) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02Allow emission of non-string objects in emit_var, instead running str() on ↵Chris Larson
it first (Bitbake rev: 5b09e28cb4a2c6c99ad58e71fb803160922a7e1e) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02emit_env: clean up, iterate onceChris Larson
(Bitbake rev: db718ec6f67c7c0d0efb4ba0b5b24384f707dcf5) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02Kill unnecessary usages of the types moduleChris Larson
types.IntType -> int types.StringType -> basestring ... Also moves our ImmutableTypes tuple into our own namespace. (Bitbake rev: 83674a3a5564ecb1f9d2c9b2d5b1eeb3c31272ab) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02Apply some 2to3 transforms that don't cause issues in 2.6Chris Larson
(Bitbake rev: d39ab776e7ceaefc8361150151cf0892dcb70d9c) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02Drop unused bb.data.expandData functionChris Larson
(Bitbake rev: 188af3ef5fdb5cd86b74147bf5eafc085ac489be) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02Add some missing docstringsChris Larson
(Bitbake rev: 20b6f2d1d2d4541e612e8cffbdf1ca4822a3e394) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02Drop some unused functionsChris Larson
(Bitbake rev: eb83df5bc7077685f314df01949cf06850e4693c) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02Drop some unused classesChris Larson
(Bitbake rev: 5cc47a49518c69c94f8b78e9dda6d542ba17b1e8) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02Formatting cleanupsChris Larson
(Bitbake rev: 2caf134b43a44dad30af4fbe33033b3c58deee57) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02Drop doctest, as we aren't utilizing itChris Larson
We should add back in some proper unit testing. Doctest is rather limited, and we haven't actually made use of it since the original implementation of the datastore when the project started, as far as I'm aware. (Bitbake rev: 3a11c2807972bbbddffde2fa67fc380d159da467) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02Move update_data into the DataSmart class as a finalize() methodChris Larson
(Bitbake rev: ff801397785567cb84b3615de86bff764d65decf) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-22Move MalformedUrl, VarExpandError into appropriate modules.Chris Larson
(Bitbake rev: e616483b237dafff7f90ba1c09e9ee7c383a2e47) Signed-off-by: Chris Larson <clarson@kergoth.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-20bitbake: Switch to bitbake-dev version (bitbake master upstream)Richard Purdie
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-05-11bitbake: Merge further fixes from upstream 1.8 branchRichard Purdie
* 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-09bitbake: Make sure existing environment variables are properly exportedRichard Purdie
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2008-10-17bitbake: Refactor the environment variable handlingRobert Bradford
Refactor the environment variable handling so that it more closes matches the changes that have been made in bitbake-dev. git-svn-id: https://svn.o-hand.com/repos/poky/trunk@5527 311d38ba-8fff-0310-9ca6-ca027cbcb966
2008-09-30bitbake/bitbake-dev: Allow much better control of which variable influence ↵Richard Purdie
bitbake from the environment git-svn-id: https://svn.o-hand.com/repos/poky/trunk@5347 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-10-22bitbake data.py: Fix unexport handling (#OE3135)Richard Purdie
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2948 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-08-20bitbake: Sync with 1.8.8 releaseRichard Purdie
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2513 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-08-16bitbake: Sync with 1.8 head. Adds locking to the fetcher to prevent parallel ↵Richard Purdie
downloads, fixes key expansion issues and occasional missing dependency graph links git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2502 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-08-12bitbake: Sync with upstream 1.8 branch for fixesRichard Purdie
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2484 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-08-03bitbake: Update along 1.8 branchRichard Purdie
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2345 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-01-08bitbake: Sync with upstream. Richard Purdie
* File licence headers were sanitised causing most of the diff. * cooker.py was created from bin/bitbake. * cvs fetcher port option was added * The -f force option was fixed to work correctly * Multiple entries in rrecrdeps are now handled correctly (allows adding do_deploy to image depends) git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1129 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-11-29bitbake: Sync with bitbake trunk for bugfixes and improved dot file ↵Richard Purdie
generation code git-svn-id: https://svn.o-hand.com/repos/poky/trunk@987 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-11-25bitbake/lib/bb/data.py: Add unexport flag for variables, add speedup for ↵Richard Purdie
expandKeys git-svn-id: https://svn.o-hand.com/repos/poky/trunk@956 311d38ba-8fff-0310-9ca6-ca027cbcb966