aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/utils.py
AgeCommit message (Collapse)Author
2016-03-06insane/prelink: Handle nonstandard library pathsRichard Purdie
Prelink contains some hardcoded assumptions about the path layout of the target system. Unfortunately if the system doesn't match, prelink doesn't work. This breaks: a) prelink of those images b) the unsafe-references-in-binaries QA test (which uses prelink-rtld) One way to work around this is to construct an ld.so.conf file which lists the library paths in question. We do this in sanity QA check and in the rootfs prelink code, being careful not to trample any existing target ld.so.conf. There is an additional problem that $LIB references in RPATHs won't be handled correctly, I've not see any system use these in reality though so this change at least improves things. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-20lib/oe/utils: Add function format_pkg_list()Mariano Lopez
The class PkgsList returns a dictionary with all the installed packages, because the data structure is a dictionary there is needed to format the data in order to write to a file. The function format_pkg_list returns a formated sting with all packages installed. The output will depend on the requested format when calling the function. [YOCTO #7427] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-06-26oe/utils.py: Add support for init/end helper functions in ThreadWorker.Aníbal Limón
Add init/end helper functions for ThreadWorker also pass ThreadWorker as first argument to init/end/func functions this enables per-thread storage handling. classes/sstate.bbclass: Add thread_worker argument to checkstatus function. Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-26oe/utils.py: Fix thread leakage in ThreadPoolAníbal Limón
In order to fix Thread leakage caused by not call join() in Threads, Pass num_tasks in ThreadPool for add all the tasks into a Queue this enable catch of Queue.Empty exception and exit the threads. classes/sstate.bbclass: Change checkstatus function to match new ThreadPool operation. Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-01oe/utils: Add simple threaded pool implementationRichard Purdie
Python 2.7 doesn't have a threaded pool implementation, just a multiprocessing one. We have need of a threaded implementation so add some simple class code to support this. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-23utils: add helper to perform the intersection of two string listsRoss Burton
Useful for e.g. generating a COMBINED_FEATURES list from DISTRO_FEATURES and MACHINE_FEATURES. Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-04-06meta/lib/oe/utils.py: Corrected the return value of both_contain()Jun Zhu
oe.utils.both_contain() should return the result as "checkvalue" or "", but the latest implement returns as "set(['checkvalue'])" or ""; It causes that bitbake.conf generates the wrong result of COMBINED_FEATURES, which contains the common components in both DISTRO_FEATURE and MACHINE_FEATURES. For example, build in Dizzy branch, COMBINED_FEATURES is "alsa usbhost ...", but recently, COMBINED_FEATURES is like "set(['alsa']) set(['usbhost']) ...". Signed-off-by: Jun Zhu <R01007@freescale.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-09meta/lib/oe/utils.py: properly implement both_contain()Cristian Iorga
oe.utils.both_contain() just does a find() on the value rather than splitting the value and then looking in the list of split items. The result is that if you add a feature to MACHINE_FEATURES that itself has a substring that matches one of the values looked for when building COMBINED_FEATURES, you end up with an incomprehensible error (here with "ext2i" in MACHINE_FEATURES): ERROR: Nothing RPROVIDES 'packagegroup-base-ext2' (but /home/balister/src/oe-core/oe-core/meta/recipes-core/ /packagegroups/packagegroup-base.bb RDEPENDS on or otherwise requires it) Fix [YOCTO #6888]. Signed-off-by: Cristian Iorga <cristian.iorga@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-11-09image-buildinfo.bbclass: new class, writes build information to imageAlejandro Hernandez
Writes build information to target filesystem on /etc/build such as enabled layers, their current status and commit. squashspaces was moved to oe/utils.py to make it available to different classes and avoid code duplication. [YOCTO #6770] Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-08-29lib/oe/utils: Make multiprocess_exec() return anythingPeter Kjellerstedt
The variable "results" was accidentally used for multiple different things at the same time, which unintentionally discarded anything that was supposed to be returned from the function... Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-23lib/oe/utils: Add utils function for multiprocess executionRichard Purdie
Our usage of multitprocessing is problematic. In particular, there is a bug in python 2.7 multiprocessing where signals are not handled until command completion instead of immediately. This factors the multiprocess code into a function which is enhanced with a workaround to ensure immediate signal handling and also better SIGINT handling which should happen in the parent, not the children to ensure clean exits. The workaround for the signals is being added to the core bb.utils function so it can benefit all users. package_manager is then converted to use the new code. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-25Globally replace oe.utils.contains to bb.utils.containsOtavio Salvador
BitBake has the exact same code as oe.utils.contains so there's no reason to duplicate it. We now rely on the bb.utils.contains code for metadata. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-11lib/oe/utils.py: add pre/post process helper functionLaurentiu Palcu
This helper function will be used to execute pre/post process commands. Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2014-01-27utils: Add a cpu_count wrapper functionRichard Purdie
Add a cpu_count wrapper function (useful from annonymous python where the import would be trickier). Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-30utils: add trim_version() functionRoss Burton
Add a helper function that returns just the first <num_parts> of <version>, split by periods. For example, trim_version("1.2.3", 2) will return "1.2". This should help reduce the spread of numerous copies of this idea across classes and recipes. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-09class/lib: Fix up various file access methodsRichard Purdie
There are various bits of cruft that have built up around our file accesses. This patch cleans some of them up, specifically: * Remove pointless "from __builtin__ import file" * Use open(), not file() * Wrap file usage in a with container to ensure files are closed * Add missing .close() calls in some cases Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-09classes/lib: Fix getcmdstatus breakageRichard Purdie
I mistakenly thought subprocess had getcmdstatus in python 2. It doesn't so lets add a wrapper and have this work in both worlds. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-09clases/lib: Use modern exception syntaxRichard Purdie
Update older code to use modern exception handling syntax which is the form accepted by python 3. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-04utils: add helper to get all non-system packagesRoss Burton
For example if PACKAGES is "foo foo-data foo-dev foo-doc", this will return "foo-data". Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-09base.bbclass: don't backfill features that already existRoss Burton
It's too easy to cause rebuilds because the DISTRO_FEATURES have changed in meaningless ways (such as re-ordering or duplicate items). Help stop this by checking if the feature to be back-filled is already present. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-17utils.py: Modify and rename distro_features_backfill python functionAndrei Gherzan
This function was written to be used with DISTRO_FEATURES. This behavior is usefull with MACHINE_FEATURES as well. Signed-off-by: Andrei Gherzan <andrei@gherzan.ro> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-07-19Remove a number of unneeded import os/bb callsRichard Purdie
The bb and os modules are always imported so having these extra import calls are a waste of space/execution time. They also set a bad example for people copy and pasting code so clean them up. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-24conf/bitbake.conf: add DISTRO_FEATURES_BACKFILLPaul Eggleton
When introducing new items to DISTRO_FEATURES that control functionality that is already enabled, in order to leave existing distro configuration unchanged we need a way to "backfill" these new feature items onto the existing DISTRO_FEATURES value. This introduces a DISTRO_FEATURES_BACKFILL variable whose items will be added to the end of DISTRO_FEATURES, unless they also appear in DISTRO_FEATURES_BACKFILL_CONSIDERED which distros can use in their configuration to prevent specific items from being added. Fixes [YOCTO #1946]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-23lib/oe/utils.py: use bb.utils.vercmp_stringAndreas Oberritter
Fixes the following warning: | WARNING: .../meta/lib/oe/utils.py:31: DeprecationWarning: Call to deprecated function bb.vercmp_string: Please use bb.utils.vercmp_string instead. | result = bb.vercmp(d.getVar(variable,True), checkvalue) Signed-off-by: Andreas Oberritter <obi@opendreambox.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-10Convert to use direct access to the data store (instead of bb.data.*Var*())Richard Purdie
This is the result of running the following over the metadata: sed \ -e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \ -e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \ -e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \ -e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \ -e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \ -e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \ -i `grep -ril bb.data *` Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-27lib/oe/util.py: Add MLPREFIX support to prune_suffix()Richard Purdie
prune_suffix() also needs be aware of MLPREFIX when changing PN for use in BPN. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-26lib/oe/utils: 'Fix' oe.utils.contains() behaviourRichard Purdie
Currently oe.utils.contains(X, "A", true, false) will return true for substring matches, e.g. if X = "ABC". This is not what most users expect from the function. In the common OE use of this function there is the case of "touchscreen" and "screen" being used as independent variables. Whilst it could be argued there isn't a problem in that specific case (touchscreens are usually on screens), there is no substring usage of this function is OE-Core so this patch changes the behaviour to match only full strings. It also fixes a bug where duplicate entries would confuse multiple matches, e.g. contains(X, ["A", "B"], ...) would match X = "A A" which is clearly wrong. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-03-21oe.utils: add inherits (sync from OE)Chris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2011-03-21oe.utils: add bb, bb.data importsChris Larson
While the metadata can and should rely on bb always being available, this needn't necessarily be the case for imported python modules. Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-08-04lib/oe: sync with OE.devJoshua Lock
Most notable change is the move to creating symlinks to patches in the metadata tree rather than copying them. Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-05-06lib/oe: Import oe lib from OE.devJoshua Lock
This library moves the common Python methods into modules of an 'oe' Python package. Signed-off-by: Joshua Lock <josh@linux.intel.com>