summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/utils.py
Commit message (Collapse)AuthorAgeFilesLines
* utils: fix gcc 10 version detectionCharles-Antoine Couret2020-09-091-1/+1
| | | | | | | | | | | | | | | | | Utils can not detect GCC 10 correctly due to wrong regex. It generates this error "ERROR: Can't get compiler version from gcc --version output" Sub-version numbers should be 1 or more digits instead of 1 only. (From OE-Core rev: 1d6f50a5e58f46f8af6e83c4e288d93a717187ea) (From OE-Core rev: e73228e6b039bd972d36774bfb360a638a03d821) Signed-off-by: Charles-Antoine Couret <charles-antoine.couret@mind.be> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 186fe4a3d390a52b87282c3e694ce3251e45ee78) Signed-off-by: Jeremy A. Puhlman <jpuhlman@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/utils: Improve multiprocess_lauch exception handlingRichard Purdie2018-12-161-2/+3
| | | | | | | | | | | | | | | | We've seen a cryptic: "ERROR: Fatal errors occurred in subprocesses, tracebacks printed above" message from oe-selftest with no other traceback information. Improve the traceback logging to try and give a better indication of any errors that is ocurring. (From OE-Core rev: 521dd3d00979a27b6932e58d5497de68abac26e1) (From OE-Core rev: 2696e69af0b32e03692d8644cc01b28dcf221aa1) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/utils: add eol to format_pkg_list()grygorii tertychnyi via Openembedded-core2018-10-111-1/+7
| | | | | | | | | | | | | | | | | Append '\n' to the non-empty formatted string before return. If you write it to the (manifest) file, it will ensure file ends with a newline. Many GNU utilities have problems processing the last line of a file if it is not '\n' terminated. E.g. if the last line is not terminated by a newline character, then "read" will read it but return false, leaving the broken partial line in the read variable(s). It can also break or adversely affect some text processing tools, that operate on the file. (From OE-Core rev: ee4d0c879713ba50dc6cc3300f44647faebee2e0) Signed-off-by: grygorii tertychnyi <gtertych@cisco.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oe/utils.py: Add vartrue()Robert Yang2018-09-131-0/+8
| | | | | | | | | | It can be used to simplify code like: "${@['iffalse', 'iftrue'][var]}" (From OE-Core rev: fc5a5af7bc3619f575988a75efc0c4fe15478b2d) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* populate_base_sdk: Stop running gcc --version all the timeRichard Purdie2018-09-051-1/+4
| | | | | | | | | | Running 'gcc --version' for every image recipe is slow and increases parsing time/resource usage for no good reason. Only compute the value in when we're really running the task/function. (From OE-Core rev: bf49316bb9913b7c89de64d6a194be31aa66e16b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/utils: Fix get_multilib_datastore to work for original tuneRichard Purdie2018-08-231-0/+3
| | | | | | | | | | | Currently the original datastore returned by this function doesn't always work as the tune isn't set back to the original. Fix it to work like all_multilib_tune_list() in utils.bbclass and correct the data returned. (From OE-Core rev: 4e1dc858fbf671ef27089a2b9bcdc965fe19d698) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/utils: Drop now unused multiprocess_execRichard Purdie2018-07-241-34/+0
| | | | | | (From OE-Core rev: f3b30def2cd1c9ede7630489c3949a45b6eba6ed) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* utils: Add multiprocess_launch API and testcaseRichard Purdie2018-07-241-0/+70
| | | | | | | | | | | | | | | | | | | | | The current methods of spawning processes for parallel execution have issues around collection of results or exceptions. Take the code from package_ipk/deb, make it generic, add a results collection mechanism, fix the exception handling and for it into a standard library function. Also add a test case which tests both the success and failure modes of operation to stop this functionality regressiing again. In particular, compared to multiprocess_exec, this fork off the parent approach means we can pass in the datastore and functions work in the same scope as the parent. This removes some of the complexities found trying to scale multiprocess_exec to wider use. (From OE-Core rev: 88f0c214e593a45566df5131bda4c946f5ccc8c2) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/utils: Improve get_multilib_datastoreRichard Purdie2018-07-021-3/+9
| | | | | | | | | | | | | Currently this function assumes that no multilib is applied and that we're applying a multilib. This means if we're in multilib context and want the non-multilib context we can't obtain it (and no other function exists for this either). Improve the function to allow this to be requested. (From OE-Core rev: 295c5a3d19834a2fac255346d0a373449cfdd776) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* utils.py: Fix parallel_make limitJoshua Watt2018-02-241-1/+1
| | | | | | | | | | | parallel_make_argument() was incorrectly taking the maximum of the limit and the calculated value instead of the minimum. (From OE-Core rev: 45205be547967c84dff96403c3a6825a62e3ca6a) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* utils.py: add parallel make helpersJoshua Watt2018-02-161-0/+43
| | | | | | | | | | | | | | | | | | | The code to extract the integer number of parallel build threads and construct a new argument from them has started to be copied in multiple locations, so create two new helper utilities to aid recipes. The first helper (parallel_make()) extracts the integer number of parallel build threads from PARALLEL_MAKE. The second (parallel_make_argument()) does the same and then puts the result back into a format string, optionally clamping it to some maximum value. Additionally, rework the oe-core recipes that were manually doing this to use the new helper utilities. (From OE-Core rev: ccd1142d22b31ed85d8823b1bc9e11ccfd72b61f) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* utils: Make get_multilib_datastore available from lib/oeRichard Purdie2018-01-041-0/+8
| | | | | | | | | Currently we can't access this function from lib/oe as its a class function. Move it to allow such access. (From OE-Core rev: b241a666f2867ffa425f6d43763d7c3c17941dcf) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/utils: remove param_bool()Ross Burton2017-12-021-11/+0
| | | | | | | | | | This function is not used by any classes or recipes that I can find, so lets delete it. (From OE-Core rev: a7cd9d1183be603777fc9c8c448281fe01224f7b) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/utils: Handle exceptions in multiprocess_execRichard Purdie2017-09-021-8/+13
| | | | | | | | | | | | Currently exceptions that happen in pool commands are ignored. Any errors would be printed on the console but everything else is silent. Switch to use pool.map_async which allows for an error_callback which we can use to detect exceptions and make sure these errors are handled. (From OE-Core rev: 7f2f9b3ff011b340b5d23bb7c47b12c357dc9f02) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* utils.py: helper function for optional include filesPatrick Ohly2017-06-121-0/+40
| | | | | | | | | | | | | | | | | | | | | | The main intention is to provide easy-to-use and read helper functions for including files only when certain distro features are set. Functionally they are the same as bb.utils.contains and bb.utils.contains_any. Distro features are part of the base configuration and thus safe to use for conditional inclusion in recipes and bbappends, in contrast to recipe variables which might still change during parsing. Therefore the check is limited to DISTRO_FEATURES. This is the reason for having this in OE-core instead of bitbake. Default values are set so that no redundant parameters have to be passed for conditional includes. As a secondary usage, the functions can also be used in boolean checks. (From OE-Core rev: 13024ce5aae453769b546d5fbe533443aec3d6fd) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/utils: Add build_depends_string functionRichard Purdie2017-01-201-0/+4
| | | | | | | | | This is useful when manipulating depends strings for task [depends] flags and is slightly easier to parse than some inline python. (From OE-Core rev: 7b05ea65a8db8a27b2a5579675775ee34ceb63c2) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta/scripts: Various getVar/getVarFlag expansion parameter fixesRichard Purdie2017-01-091-1/+1
| | | | | | | | | | | | | | | | | There were a few straggling expansion parameter removals left for getVar/getVarFlag where the odd whitespace meant they were missed on previous passes. There were also some plain broken ussages such as: d.getVar('ALTERNATIVE_TARGET', old_name, True) path = d.getVar('PATH', d, True) d.getVar('IMAGE_ROOTFS', 'True') which I've corrected (they happend to work by luck). (From OE-Core rev: 688f7a64917a5ce5cbe12f8e5da4d47e265d240f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/utils: Drop python2 compatibility codeRichard Purdie2016-12-221-7/+2
| | | | | | | | | We've moved to python3, we don't need this compatibility code which just makes the code less readable. (From OE-Core rev: 425afe2484707640ac71194885fdb263e95e9950) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* utils: Always use datastore's PATH for host_gcc_versionRoss Burton2016-12-161-4/+8
| | | | | | | | | | | BUILD_CC may reference something like ccache and expect this to come from ccache-native, we at least have some selftests which assume this. Modify the code to use PATH when runnig BUILD_CC to ensure the tests continue to work as expected. (From OE-Core rev: f3e753372baac43d0921186340cf260df056de20) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta: remove True option to getVar callsJoshua Lock2016-12-161-15/+15
| | | | | | | | | | | | | 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\) (From OE-Core rev: 7c552996597faaee2fbee185b250c0ee30ea3b5f) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* uninative: rebuild uninative for gcc 4.8 and 4.9Ed Bartosh2016-12-161-0/+14
| | | | | | | | | | | | | | | | | | | Some c++ libraries fail to build if uninative is built with gcc 5.x and host gcc version is either 4.8 or 4.9. The issue should be solved by making separate uninative sstate directory structure sstate-cache/universal-<gcc version> for host gcc versions 4.8 and 4.9. This causes rebuilds of uninative if host gcc is either 4.8 or 4.9 and it doesn't match gcc version used to build uninative. [YOCTO #10441] (From OE-Core rev: d36f41e5658bbbb6080ee833027879c119edf3e0) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta: cleanup d.getVar(var, 1)Robert Yang2016-09-141-2/+2
| | | | | | | | (From OE-Core rev: 79fe476be233015c1c90e9c3fb4572267b5551d1) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image: add do_image_qa task to run QA checks on the constructed imageJoshua Lock2016-07-201-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This task runs all functions in IMAGE_QA_COMMANDS after the image construction has completed in order to validate the resulting image. Image sanity checks should either be Python functions which raise bb.build.FuncFailed on failure or shell functions with return a non-zero exit code. Python functions may instead raise an oe.utils.ImageQAFailed Exception which takes an extra argument, a description of the failure. python image_check_python_ok () { if True: raise bb.build.FuncFailed('This check always fails') else: bb.note("Nothing to see here") } image_check_shell_ok () { if true exit 1 else exit 0 fi } [YOCTO #9448] (From OE-Core rev: c9bef2ecf1a30159d11781184829f41844a58c13) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/lib: Complete transition to python3Richard Purdie2016-06-021-3/+3
| | | | | | | | | This patch contains all the other misc pieces of the transition to python3 which didn't make sense to be broken into individual patches. (From OE-Core rev: fcd6b38bab8517d83e1ed48eef1bca9a9a190f57) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/lib: Update to explictly create lists where neededRichard Purdie2016-06-021-3/+3
| | | | | | | | | Iterators now return views, not lists in python3. Where we need lists, handle this explicitly. (From OE-Core rev: caebd862bac7eed725e0f0321bf50793671b5312) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta: Update to modern exception syntaxRichard Purdie2016-05-211-1/+1
| | | | | | | | | Update older exception syntax to modern one required by python 3. Compatible with python 2.7. (From OE-Core rev: d13f0ac614f1d1e2ef2c8ddc71cbfcf76a8dc3f2) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta/selftest/scripts: Use print function for python3 compatibilityRichard Purdie2016-05-211-1/+1
| | | | | | | | | | | | Used print function instead of print statement to make the code work in python 3. [Changes from both Ed and Richard] (From OE-Core rev: ced1995694c394d92cb82fb9c25a33dc027a3b69) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* insane/prelink: Handle nonstandard library pathsRichard Purdie2016-03-071-0/+11
| | | | | | | | | | | | | | | | | | | | | | 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. (From OE-Core rev: 7fd1d7e639c2ed7e0699937a5cb245c187b7c811) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/utils: Add function format_pkg_list()Mariano Lopez2016-01-201-0/+22
| | | | | | | | | | | | | | | | | | 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] (From OE-Core rev: 25725e6e5fff8017aaf3a6fcd9b1b893c22630b5) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oe/utils.py: Add support for init/end helper functions in ThreadWorker.Aníbal Limón2015-06-261-4/+13
| | | | | | | | | | | | | | 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. (From OE-Core rev: 08c50d62b520c8405f034e3d7adeea89e06226ee) Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oe/utils.py: Fix thread leakage in ThreadPoolAníbal Limón2015-06-261-6/+20
| | | | | | | | | | | | | | | 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. (From OE-Core rev: 524d92ed7b53bef933527095e82f378b934f25ef) Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oe/utils: Add simple threaded pool implementationRichard Purdie2015-06-031-0/+41
| | | | | | | | | | 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. (From OE-Core rev: 44ae778fefca5112900b870be7a485360c50bc2e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* utils: add helper to perform the intersection of two string listsRoss Burton2015-05-241-0/+15
| | | | | | | | | | Useful for e.g. generating a COMBINED_FEATURES list from DISTRO_FEATURES and MACHINE_FEATURES. (From OE-Core rev: c5b6f672b88f5f42fe0bd59d28104b8dc9ee9a6e) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta/lib/oe/utils.py: Corrected the return value of both_contain()Jun Zhu2015-04-081-1/+1
| | | | | | | | | | | | | | | | 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']) ...". (From OE-Core rev: c4ca9dbd4191fcff08e75035e3d276490ed80b05) Signed-off-by: Jun Zhu <R01007@freescale.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta/lib/oe/utils.py: properly implement both_contain()Cristian Iorga2015-03-101-1/+9
| | | | | | | | | | | | | | | | | | | | | | 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]. (From OE-Core rev: e7375f73bd8052d012e35d4ebaee09a55417581f) Signed-off-by: Cristian Iorga <cristian.iorga@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image-buildinfo.bbclass: new class, writes build information to imageAlejandro Hernandez2014-11-091-0/+4
| | | | | | | | | | | | | | | | 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] (From OE-Core rev: c9cc652e88ddedddf8a2f23fb9b8c024616526d7) Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/utils: Make multiprocess_exec() return anythingPeter Kjellerstedt2014-08-291-2/+2
| | | | | | | | | | | 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... (From OE-Core rev: abf4eb613eba0892a5f240de7aa3a9a1b2879354) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/utils: Add utils function for multiprocess executionRichard Purdie2014-08-231-0/+29
| | | | | | | | | | | | | | | | | | 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. (From OE-Core rev: 72d153a3a90d31d9f4e41d77da24e44ccb33c56e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* Globally replace oe.utils.contains to bb.utils.containsOtavio Salvador2014-04-251-13/+0
| | | | | | | | | | | 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. (From OE-Core rev: 93499ebc46547f5bf6dcecd5a786ead9f726de28) Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/utils.py: add pre/post process helper functionLaurentiu Palcu2014-02-111-1/+11
| | | | | | | | | This helper function will be used to execute pre/post process commands. (From OE-Core rev: 23d409558cb12cbf0300156e67f768a13442910a) Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* utils: Add a cpu_count wrapper functionRichard Purdie2014-01-281-0/+4
| | | | | | | | | Add a cpu_count wrapper function (useful from annonymous python where the import would be trickier). (From OE-Core rev: 0ae27a55759e7c4254e704e18b304d40013cb5c3) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* utils: add trim_version() functionRoss Burton2013-05-301-0/+15
| | | | | | | | | | | | | | 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. (From OE-Core rev: 17a12e3c62807a7d60fcbf0aa4fd9cf4a739a204) 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>
* class/lib: Fix up various file access methodsRichard Purdie2013-05-091-2/+4
| | | | | | | | | | | | | | 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 (From OE-Core rev: a43e0a8ecd0441131e929daf998c3cd454d9c8f3) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/lib: Fix getcmdstatus breakageRichard Purdie2013-05-091-0/+10
| | | | | | | | | I mistakenly thought subprocess had getcmdstatus in python 2. It doesn't so lets add a wrapper and have this work in both worlds. (From OE-Core rev: 2253e9f12734c6e6aa489942b5e4628eca1fa29d) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* clases/lib: Use modern exception syntaxRichard Purdie2013-05-091-1/+1
| | | | | | | | | Update older code to use modern exception handling syntax which is the form accepted by python 3. (From OE-Core rev: b010501cd089e649a68f683be0cf4d0aac90fbe3) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* utils: add helper to get all non-system packagesRoss Burton2013-04-041-0/+16
| | | | | | | | | | For example if PACKAGES is "foo foo-data foo-dev foo-doc", this will return "foo-data". (From OE-Core rev: 3115187e468398a8c1edaf3e5369a2d10fb112f4) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* base.bbclass: don't backfill features that already existRoss Burton2013-03-101-5/+3
| | | | | | | | | | | 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. (From OE-Core rev: 63c7192119d54b92d908441109ed4e4fff761cba) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* utils.py: Modify and rename distro_features_backfill python functionAndrei Gherzan2012-08-171-3/+6
| | | | | | | | | | | This function was written to be used with DISTRO_FEATURES. This behavior is usefull with MACHINE_FEATURES as well. (From OE-Core rev: 8ae08529e844c9e065c1d260535a777f85d8c6cc) Signed-off-by: Andrei Gherzan <andrei@gherzan.ro> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* Remove a number of unneeded import os/bb callsRichard Purdie2012-07-191-2/+0
| | | | | | | | | | 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. (From OE-Core rev: 7d674820958be3a7051ea619effe1a6061d9cbe2) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* conf/bitbake.conf: add DISTRO_FEATURES_BACKFILLPaul Eggleton2012-02-241-0/+20
| | | | | | | | | | | | | | | | | | | 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]. (From OE-Core rev: 738658d9d5ddef026d2929188744aa225324bf26) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>