aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/data_smart.py
AgeCommit message (Collapse)Author
2010-05-22Revert "In expand, drop the unnecessary second regular expression match"Chris Larson
This reverts commit 05462fa7908fc22988b3dc9d376798d0a46ccb5a.
2010-05-21In expand, drop the unnecessary second regular expression matchChris Larson
Signed-off-by: Imran Mehmood <imran_mehmood@mentor.com> Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-04-21Simplify _findVar a bitChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-04-21Fix major bug that slipped in when moving update_dataChris Larson
The root cause is, I was testing the use of renameVar() from finalize, in order to get flags copied over when an override is applied, but renameVar removes the original, whereas the old code did not do so. Going back to the old method, will revisit the override/flags later on. Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-04-20For ${@}, run str() on the resultChris 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-09Exception handling fixupsChris Larson
2010-04-09Import fixupsChris 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-03-30Consolidate the exec/eval bits, switch anonfunc to better_exec, etcChris Larson
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. Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-03-30Pass an empty locals dict in expansion, since list comprehensions apparently ↵Chris Larson
leak their '_' helper variable Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-03-30Two minor changes to the way python snippet expansion happensChris Larson
- Use a single dictionary for the context, both global & local, since for some reason it chokes wanting a global "d" rather than a local in the metadata. - First compile the string into a code object before running eval, so we can include the variable name in an evaluation error. Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-03-24data_smart: be explicit about what we make available to eval'd python codeChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-02-25Avoid unnecessary calls to keys() when iterating over dictionaries.Chris Larson
dict objects provide an __iter__ method for the iteration which gives you the keys, so calling keys directly is unnecessary, and isn't really a best practice. The only time you really need to call the keys is if there's a danger of the dict changing out from underneith you, either due to external forces or due to modification of the iterable in the loop. Iterations over os.environ are apparently subject to such changes, so they must continue to use keys(). As an aside, also switches a couple spots to using sorted() rather than creating a temporary list with keys() and sorting that. Signed-off-by: Chris Larson <clarson@mvista.com>
2010-01-19data_smart.py: Fix error where update-rc.d would not get added to the ↵Richard Purdie
dependency tree (from Poky) If there was a variable such as: X_${Y}_append = "Z" The "Z" would be lost if X_${Y} was unset. This was due to a bug in the renameVar function used by expandKeys(). Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-04-21lib: remove use of 'sets' to make Python 2.6 happyMarcin Juszkiewicz
Acked-by: Chris Larson <clarson@kergoth.com>
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.
2008-02-24data_smart: Fix getVarFlags bug in data_smartRichard Purdie
2007-08-16data_smart.py: Add has_key() check before accessing dataRichard Purdie
2007-08-15data/data_smart.py: Add data.renameVar()Richard Purdie
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_smart: Micro optimisation - search for "${" instead of "$"Richard Purdie
2006-10-03data_smart.py: Add expand_cache, caching expanded data (but wiped on any ↵Richard Purdie
write to the data) - gives a performance improvement
2006-09-09Complete conversion to use bb.msgRichard Purdie
2006-05-04bitbake/lib/bb/data_smart.py: Double OVERRIDE expansion fixHolger Hans Peter Freyther
INITSCRIPT_PARAMS_${PN}_slugos. We will expandKeys and end up with INITSCRIPT_PARAMS_busybox_slugos then (we have slugos in OVERRIDES) and we get INITSCRIPT_PARAMS_busybox. Now adding busybox to OVERRIDES and nothing changed. The reason is simple. The update_data code is using __getitem__ and __setitem__ to access the data object. This method does not pay the cookie monster. This is why we don't know that for the OVERRIDE busybox INITSCRIPT_PARAMS is available. We now pay the cookie monster and it looks better
2006-04-29bb/data_smart.py:Richard Purdie
- Doesn't need pickle anymore so don't import it
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/data_smart.py:Holger Hans Peter Freyther
-Avoid issues with the assignment. Make sure we assign special to special and seen to seen.
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)
2006-04-16Revert r444 as it is giving errors with keys...Holger Hans Peter Freyther
2006-04-16bitbake/lib/bb/data_smart.py:Holger Hans Peter Freyther
My first failed attempt to create something compatible with a Dictionary with COW/parenting features Use this new class for the Override Helpers bitbake/lib/bb/data.py: Update to the new data structure, it can't be treated as a dict, it is not a dict. We will use keys() (O(n)) and get
2006-04-15bitbake/lib/bb/data.py:Holger Hans Peter Freyther
-Remove the 'Proxies' for the pkgdata Cache -Remove the pkgdata() method as we now have a different caching strategy -Alter init_db to only take a parent and call createCopy directly bitbake/lib/bb/data_smart.py: -Remove the DataSmartPackage class as it is not needed bitbake/lib/bb/cache.py: -Call init_db with the only reasonable argument
2006-04-15lib/bb/data_smart.py:Holger Hans Peter Freyther
For now we are forced to deepcopy these two dictonaries. This is a first aid band aid to have something working. We will kill the DataSmartPackage class completely
2006-04-15bitbake/lib/bb/data.py:Richard Purdie
bitbake/lib/bb/__init__.py: bitbake/lib/bb/data_smart.py: bitbake/lib/bb/cache.py: bitbake/lib/bb/shell.py: bitbake/bin/bitbake: * Major cache refactoring. Change the cache to store only the data bitbake needs for dependency calculations instead of all the metadata. * Separate the cache code into its own file. * Update the rest of the code to work with the cache changes. * Temporarily break the shell's poke command.
2006-04-15bitbake/lib/bb/data_smart.py:Holger Hans Peter Freyther
Partially undo r420. We do not need to shadow the variable, for our view we have set our version (an empty one) already
2006-03-30lib/bb/data_smart.py:Holger Hans Peter Freyther
-The pickling API is not too obvious. One can not call p.dump multiple times. Instead we store it as a tuple. -Same applies for unpickling. -Hmm current programming languages suck. It can't be true to use multiple assignment for something as easy as a 'symmetric' command.
2006-03-29bitbke/lib/bb/data_smart.py:Holger Hans Peter Freyther
-createCopy is not called, instead a constructor is invoked. Copy the cookies here as well. Currently I only copy them from 'clean' as we should have them pickled already...
2006-03-29bitbake/lib/bb/data_smart.py:Holger Hans Peter Freyther
Remember what we paid to the Cookie Monster. Make a copy of it. Currently we do no removal of these keys so I hope to get around the shallow copies as welbitbake/lib/bb/data_smart.py: Remember what we paid to the Cookie Monster. Make a copy of it. Currently we do no removal of these keys so I hope to get around the shallow copies as welll
2006-03-29bitbake/lib/bb/data.py:Holger Hans Peter Freyther
-Only have one expand method in the dict implementation. -Apply some magic knowledge by feeding the cookie master. -Speed up update_data by asking the Cookie Monster for help. We do not iterate over each key, but the keys we know that have the data we care about. This gives a huge speed improvement to parsing. bitbake/lib/bb/data_smart.py: -Make setVar more expensive by feeding the cookie monster
2006-03-23bitbake/lib/bb/cache:Holger Hans Peter Freyther
-Fix the method invocation in methodpool to use the right amount of arguments -Update data_smart to the new cache layout of the file functions
2006-03-22lib/bb/data_smart.py:Holger Hans Peter Freyther
ReAdd the handlers when unpickling the file parse/parse_py/BBHandler.py: Save the once added handlers in the bitbake file.
2006-03-07bitbake/lib/bb/data_smart.py:Holger Hans Peter Freyther
Give a filename to the better compile method. (sorry)
2006-03-07bitbake/lib/bb/data_smart.py,event.py:Holger Hans Peter Freyther
Use bb.utils.better_compile instead of the simple compile for better error reporting
2005-08-04bitbake/lib/bb/data_smart.py:Holger Hans Peter Freyther
-Do not write the global configuration file into each cached file. On unpickling reattach a current configuration file. This is based on the work of proti http://www.frankengul.org/~seb/cow/cow8a.patch and was adopted to the current data_smart instance. CVSDATE, BUILDSTART and similiar should be always current again
2005-06-17make the cache also work when you use softlinks to the packages - patch ↵Michael 'Mickey' Lauer
courtesy Holger Schurig
2005-05-28bitbake/lib/bb/*:1.3.0Holger Hans Peter Freyther
include 'time' into the scope. For bitbake 1.3.1 we need to define which modules will be visible when executing embedded python methods
2005-05-21bitbake/lib/bb/data_smart.py:Holger Hans Peter Freyther
-Do a deepcopy of the parent for the persistent data storage constructor. -Store the dict as _data member and not the instance -Operate on the dict in the methods instead of the DataSmart instances... Happy deletion of the cache
2005-05-20bitbake/lib/bb/data_smart.py:Holger Hans Peter Freyther
Return only the mtime from the os.stat syscall bitbake/lib/bb/data_dict.py: Return only the mtime from the os.stat syscall