summaryrefslogtreecommitdiffstats
path: root/lib/bb/data.py
AgeCommit message (Collapse)Author
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] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-04codeparser: 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. Signed-off-by: Christopher Larson <chris_larson@mentor.com>
2011-11-04codeparser: 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 Signed-off-by: Christopher Larson <chris_larson@mentor.com>
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> 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. Signed-off-by: Joshua Lock <josh@linux.intel.com>
2011-06-15make exception handling syntax consistentScott Garman
Update exception handling syntax to use the modern style: except ExcType as localvar Signed-off-by: Scott Garman <scott.a.garman@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-08data.py: Ensure vardeps flags get expandedRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-21bitbake/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. (From Poky rev: 25b3d39612c0bea1d136e346d938abde56aa699f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-07Merge branch 'poky-sync'Chris Larson
* poky-sync: build: kill unneeded environment setup bits parse: save python functions into the metadata Include exported variables in task process env runqueue: start implementing quieterrors Overhaul environment handling runqueue: resurrect use of file objects for pipein/pipeout runqueue: clean up message log levels runqueue: use correct task ID when checking validity of setscene tasks Add support for 'noexec' tasks runqueue: implement cache checking from metadata runqueue: pass task hash information to tasks runqueue: avoid unnecessary delays Implement task signatures data: Add emit_func and generate_dependencies codeparser: Implement persistent cache data_smart: track variable references codeparser: add module for parsing shell/python runqueue: implement scenequeue fetch: add SRC_URI checksum Signed-off-by: Chris Larson <chris_larson@mentor.com>
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. (From Poky rev: 6f454c10bcdd5) Signed-off-by: Lianhao Lu <lianhao.lu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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). Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-12-30Include exported variables in task process envChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-12-29Overhaul 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. Signed-off-by: Richard Purdie <rpurdie@linux.intel.com> Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-12-29data: Add emit_func and generate_dependenciesRichard Purdie
These functions allow generation of dependency data between functions 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-05-21Don't emit vars starting with __, as those are internalChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-04-20Enhance the expansion exception messageChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-04-20Allow emission of non-string objects in emit_var, instead running str() on ↵Chris Larson
it first Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-04-20emit_env: clean up, iterate onceChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-04-12Kill unnecessary usages of the types moduleChris Larson
types.IntType -> int types.StringType -> basestring ... Also moves our ImmutableTypes tuple into our own namespace. Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-04-11Apply some 2to3 transforms that don't cause issues in 2.6Chris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-04-11Drop unused bb.data.expandData functionChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-04-09Add some missing docstringsChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-04-09Drop some unused functionsChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-04-09Drop some unused classesChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-04-09Formatting cleanupsChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-04-09Move update_data into the DataSmart class as a finalize() methodChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-04-09Drop 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. Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-02-19Move MalformedUrl, VarExpandError into appropriate modules.Chris Larson
Signed-off-by: Chris Larson <clarson@kergoth.com>
2009-05-11data.py: Make sure allowed variables inherited from the environment are ↵Richard Purdie
exported again (from Poky) shell.py: When running a stage task in bbshell, run populate_staging, not the stage task (from Poky)
2009-05-11[bb] Remove unused imports reported by pyflakesHolger Hans Peter Freyther
2009-05-11[bb] Fix the tests by setting a debug level at startHolger Hans Peter Freyther
In preparation for python3.0 make sure our test cases are working again.
2008-12-06Pass around the tasks to execute rather than using magic variables. Also use ↵Richard Purdie
the empty_environment() function to clear the environment
2008-09-30bin/bitbake: Add better environmental variable handling. By default it will ↵Richard Purdie
now only pass certain whitelisted variables into the data store. If BB_PRESERVE_ENV is set bitbake will use all variable from the environment. If BB_ENV_WHITELIST is set, that whitelist will be used instead of the internal bitbake one. Alternatively, BB_ENV_EXTRAWHITE can be used to extend the internal whitelist.
2007-10-22data.py: Fix unexport handling (#3135)Richard Purdie
2007-08-17data.py: Split expandKeys into two for loops to benefit from the ↵Richard Purdie
expand_cache (12% speedup)
2007-08-15data/data_smart.py: Add data.renameVar()Richard Purdie
2007-08-13data.py: Comment last accidental commitRichard Purdie
2007-08-13cooker.py: Start UI merge: Cleanup exit status handling and collect exit ↵Richard Purdie
calls into one place. Move buildSetVars() function calls. Cleanup whitespace. Make some of the core functions more generic.
2007-07-31data.emit_var() - only call getVar if we need the variableRichard Purdie
2007-01-04drop shebangs from lib/bb scriptsMarcin Juszkiewicz
- those scripts are not called by hand by bitbake users and most of package linting tools (lintian/Debian, rpmlint/Fedora) complain about not executable scripts. - if someone want to run them by hand then he will be able to do it with calling 'python SCRIPT'
2006-12-08Add proper GPLv2 headers to all BitBake filesHolger Hans Peter Freyther
BitBake trunk is now GPLv2 only, no mix of MIT,FreeBSD License is left. Update GPL headers to point to the correct address of the FSF Update the list of authors. Uli Luckas, Seb Frankengul and Tim Amsell contributed to the sourcecode as well
2006-11-25data.py: Revert inherits_class change - merge error :-(Richard Purdie
2006-11-25data.py: Fix inherits_class() so it doesn't split lists. Add unexport ↵Richard Purdie
handling to emit_env.
2006-11-18Hack to avoid 3 million key expansions by a simple string matchHolger Hans Peter Freyther
2006-11-17Micro-Optimisation for parsing. Do not join and split the inherit_cache over ↵Holger Hans Peter Freyther
and over again
2006-11-10data.py: Fix emit_env() to expand keynames as well as valuesRichard Purdie
2006-09-09Complete conversion to use bb.msgRichard Purdie
2006-05-27 bitbake/lib/bb/data.py:Holger Hans Peter Freyther
Add another testcase regarding createCopy and update_data
2006-04-28 bitbake/lib/bb/data_smart.py:Holger Hans Peter Freyther
Remove my broken COW version, use mithros COW module instead. Make it 'work' with the code bitbake/lib/bb/data.py: Update to use the iter protocol again and has_key
2006-04-20bitbake/lib/bb:Holger Hans Peter Freyther
Make the Cookie Monster Dict a METACLASS? To exploit automatically the COW features... Small performance analysis is showing that this is saving some time (and memory as well)