summaryrefslogtreecommitdiffstats
path: root/lib/bb/persist_data.py
AgeCommit message (Collapse)Author
2017-01-06prserv/persist_data/utils: Drop obsolete python2 importsRichard Purdie
These imports were from python 2.6 and earlier, 2.4 in some cases. Drop them since we're all python3 now. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-30bitbake: remove True option to getVar callsJoshua Lock
getVar() now defaults to expanding by default, thus remove the True option from getVar() calls with a regex search and replace. Search made with the following regex: getVar ?\(( ?[^,()]*), True\) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11persist_data: Fix py3 update stack overflowRichard Purdie
Revision d0f904d407f57998419bd9c305ce53e5eaa36b24 accidentally broke items() and values() and made them cause stack overflows. Undo that breakage. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-01bitbake: Convert to python 3Richard Purdie
Various misc changes to convert bitbake to python3 which don't warrant separation into separate commits. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-05persist_data: Return str instead of unicode for sqlite3 text queriesKlauer, Daniel
Python 2's sqlite3 module defaults to returning Unicode strings for SQL text queries, which could trickle down to other parts of bitbake code and cause unexpected Unicode conversions. Using byte strings avoids this issue. For example, the git fetcher's AUTOREV support caches HEAD SHA1's using bb.persist_data, so sometimes the git command strings passed to fetch2's runfetchcmd() were unicode, potentially causing UnicodeDecodeErrors when it appended the values of environment variables containing non-ASCII chars. [YOCTO #9382] Signed-off-by: Daniel Klauer <daniel.klauer@gin.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-03persist_data: Avoid fsync() callsRichard Purdie
If the power were to fail, it doesn't matter to us much if the data makes it to disk or not, we'd have other problems. However an fsync() call on a multi build autobuilder is painful so lets avoid them. This is particularly true in this case if a timeout causes a reconnect during a build. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-22persist_data: add get_by_pattern method to APIConstantin Musca
- one can use get_by_pattern to get a list of values associated with keys that match the specified pattern Signed-off-by: Constantin Musca <constantinx.musca@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-16persist_data: survive if sqlite3 couldn't enable the shared cacheChristopher Larson
Signed-off-by: Christopher Larson <kergoth@gmail.com>
2012-01-19bitbake/persist_data: Reconnect when DB is lockedLianhao Lu
[YOCTO #1761] Reconnect to the backend Sqlite DB in 'database is locked' exception so the timeout can be leveraged in each time retry. Signed-off-by: Lianhao Lu <lianhao.lu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-27Update users of getVar/setVar to use the data store functions directlyRichard Purdie
(From Poky rev: affd0907253387cee0ba0c7e9f92bcc109895446) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-09persist_data: Add back code to retry in the case of locked database errorsRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-04-05persist_data: implement comparison, same as dictChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2011-04-05persist_data: make SQLTable a context managerChris Larson
This can be used for more control over the underlying transactions. Unlike the context manager of, say, a file object, we can still use the object even after the end of a given with block, as the context manager exit only ensures we've committed to the database, not that we have closed the database. Signed-off-by: Chris Larson <chris_larson@mentor.com>
2011-04-05persist_data: don't allow non-string keys/valuesChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2011-04-05persist_data: add has_keyChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2011-04-05persist_data: raise KeyError on missing elementsChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2011-03-16Initial work on getting bitbake working under pypyChris Larson
- use os.chmod, not os.fchmod, as the latter is missing under pypy - rearrange our imports a bit - don't die if sqlite3 is missing shared cache support Signed-off-by: Chris Larson <chris_larson@mentor.com>
2011-02-11Enable some DeprecationWarningsChris Larson
We'll be skipping the Pending Deprecation step given our release process. Signed-off-by: Chris Larson <chris_larson@mentor.com>
2011-02-11persist_data: handle lock in sqlite and use the shared cacheChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2011-02-11persist_data: drop SQLData indirectionChris Larson
The common case (if not the only case) is to only use a single domain. The only reason SQLData exists is to make it easier to delete a domain. Yet, there's no need for us to delete a domain if SQLTable knows how to clear itself out. So, add clear() to the table and pass the domain to persist(). Signed-off-by: Chris Larson <chris_larson@mentor.com>
2011-02-11persist_data: use better items/values methods for SQLTableChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2011-02-08persist_data: kill unreachable break lineChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2011-02-08persist_data: loop on database lock for table creationChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2011-01-10persist_data: Don't loop forever waiting on database locksRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2010-12-23persist_data: unbork the resurrect of select lock waitChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-12-23persist_data: resurrect the lock wait for selectsChris Larson
Think this got inadvertantly dropped when switching to the new API. Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-12-10Rework the persist_data APIChris Larson
Rather than having to run .addDomain() and then .getValue(domain, key), .setValue(domain, key), etc, now it just works as mappings. As an example: setValue(domain, key) -> persist[domain][key] = value It also arranges things so we can construct objects of this type using any arbitrary filename/path for the sqlite3 database, rather than being so tightly bound to the metadata. Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-11-19Revert "persist_data: cache connection and use cursor"Chris Larson
Caching the database connection can cause serious issues if it results in multiple processes (e.g. multiple tasks) simultaneously using the same connection. This reverts commit 8a6876752b90efd81d92f0947bfc9527d8260969. Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-11-18persist_data: handle locked db for SELECTChris Larson
Parallel processes interacting with the persist_data db can quite easily explode without this. Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-09-03Switch bitbake internals to use logging directly rather than bb.msgChris Larson
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 Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-06-04persist_data: cache connection and use cursorBernhard Reutner-Fischer
Store database connection to persistent database in fetcher. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> 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-10Switch some references to moved functionsChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-04-09Formatting cleanupsChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2009-10-17Add a compare-versions command which returns whether the SRCREV versions ↵Richard Purdie
have changed since bitbake was last run (from Poky) Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
2008-05-11Allow to store the PersistData in a PERSISTENT_DIR.Holger Hans Peter Freyther
If PERSISTENT_DIR is used wiping the tmpdir will not wipe the PersistData which sometines is wanted (e.g. for git SRCREVs). Acked-By: Richard
2008-01-20persist_data.py: Add sqlite version checksRichard Purdie
2007-08-05persist_data: Retry if database locked, update MANIFESTRichard Purdie
2007-07-29persist_data.py: Try harder to import an sqlite package. Show how to change ↵Richard Purdie
the connection lock timeout
2007-07-29persist_data: Remove bogus testing codeRichard Purdie
2007-07-28Add persistent data store moduleRichard Purdie