summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/prservice.py
AgeCommit message (Collapse)Author
2023-12-24lib/prservice: Improve lock handling robustnessRichard Purdie
It is possible we could crash holding a lock whilst parsing in this code. Switch to use utils.fileslocked() in the with expression to avoid this. This may be causing some of our strange intermittent failures in PRServ tests. (From OE-Core rev: 4e59db15e5df2cc3d0ae042454812a2d54cef77b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-12lib: Add copyright statements to files without oneRichard Purdie
Where there isn't a copyright statement, add one to make it explicit. Also add license identifiers as MIT if there isn't one. (From OE-Core rev: bb731d1f3d2a1d50ec0aed864dbca54cf795b040) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-23prservice: remove connection cachingScott Murray
This patch is a follow on of the the PR server rework in bitbake to add read-only support. The shift to using the bb.asyncrpc code in the PR server and client brings issues with respect to reuse of the same asyncio loop in different processes. This patch removes the PR service connection caching to avoid one source of this problem. It is believed that in practice this should have little impact on overall performance. (From OE-Core rev: 0fc3055027e2a76ac863f1c0e0d52e95748066aa) Signed-off-by: Scott Murray <scott.murray@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-01prservice: Use new connect APIPaul Barker
The new prserv connect() function decouples the code in oe-core from the exact classes and implementation details used within bitbake. This allows us to more easily switch over to a new asyncrpc based prservice. (From OE-Core rev: 6bf39c5c8cf09e3f2ce6eba13b9d18193bce9655) Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-11-16meta: drop _PYTHON_SYSCONFIGDATA_NAME hacksAlexander Kanavin
(From OE-Core rev: d3a81dd0e72a3495bfc7cc969c2bb806b666023d) Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-04-05prservice.py: fix do_package with newer Python in Ubuntu 20.04Martin Jansa
* with Ubuntu 20.04 which is using python 3.8 I'm seeing a lot of errors like: ERROR: libxml2-2.9.10-r0 do_package: Can NOT get PRAUTO, exception No module named '_sysconfigdata' not sure what caused this from python 3.8, but this seems to work * PRserv is enabled with: PRSERV_HOST = "localhost:0" (From OE-Core rev: 4b26eaf7152fb712aba47a0c746333578f58ee8d) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-31prservice.py: Use "with" to control file handle lifetimePeter Kjellerstedt
(From OE-Core rev: e7f025c87d595d2e37f83b75f11bedf2bce7bcc0) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-09meta/lib+scripts: Convert to SPDX license headersRichard Purdie
This adds SPDX license headers in place of the wide assortment of things currently in our script headers. We default to GPL-2.0-only except for the oeqa code where it was clearly submitted and marked as MIT on the most part or some scripts which had the "or later" GPL versioning. The patch also drops other obsolete bits of file headers where they were encoountered such as editor modelines, obsolete maintainer information or the phrase "All rights reserved" which is now obsolete and not required in copyright headers (in this case its actually confusing for licensing as all rights were not reserved). More work is needed for OE-Core but this takes care of the bulk of the scripts and meta/lib directories. The top level LICENSE files are tweaked to match the new structure and the SPDX naming. (From OE-Core rev: f8c9c511b5f1b7dbd45b77f345cb6c048ae6763e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-16meta: 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\) (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>
2016-06-02classes/lib: Update to explictly create lists where neededRichard Purdie
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>
2016-05-21meta: Update to modern exception syntaxRichard Purdie
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>
2013-05-09image/kernel-module-split/eglibc-ld.inc: Remove has_key() usageRichard Purdie
The has_key() attribute has been removed in python 3 since there is better syntax available. Use the improved syntax. (From OE-Core rev: 3dff13793e875ff58cc38c4a960caca9b6969843) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-25prservice.py: fix NameError: global name 'host' is not definedMartin Jansa
* http://git.openembedded.org/openembedded-core/commit/?id=e00f49de8b1f79c3e07b887d257bd75a46052fa0 removed host and port variables (From OE-Core rev: 494439c95d33b2ad457cc205413680b0bf176560) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-25prserv: change PRSERV_HOST semanticsConstantin Musca
- remove PRSERV_PORT variable - use 'hostname:port' as PRSERV_HOST format - remove USE_PR_SERV variable - one can activate PRS by setting PRSERV_HOST [YOCTO #3744] (From OE-Core rev: e00f49de8b1f79c3e07b887d257bd75a46052fa0) Signed-off-by: Constantin Musca <constantinx.musca@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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. (From OE-Core rev: 7d674820958be3a7051ea619effe1a6061d9cbe2) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-08prservice: Added sanity check for prservice connection.Lianhao Lu
Fixed bug [YOCTO #2052]. Added sanity check for variables of PRSERV_HOST and PRSERV_PORT, also for the connection availabity of prservice. (From OE-Core rev: 7588a4f2e2728da0ff7a773b18527f3711b138f2) Signed-off-by: Lianhao Lu <lianhao.lu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-11meta/PRService: Added export/import fuctions.Lianhao Lu
[YOCTO #1556] - Modified meta/class/package.bbclass and prserv.bbclass according to the change in PR service by adding PACKAGE_ARCH into the query tuple. - Added prexport.bbclass, primport.bbclass to export/import AUTOPR values from/to PRService. - Move PR service related common code to lib/oe/prservice.py. - Supported reading the AUTOPR values from the exported .inc file instead of reading it from remote PR service. - Created a new script bitbake-prserv-tool to export/import the AUTOPR values from/to the PR service. Typical usage scenario of the export/import is: 1. bitbake-prserv-tool export <file> to export the AUTOPR values from the current PR service into an exported .inc file. 2. Others may use that exported .inc file(to be included in the local.conf) to lockdown and reproduce the same AUTOPR when generating package feeds. 3. Others may "bitbake-prserv-tool import <file>" to import the AUTOPR values into their own PR service and the AUTOPR values will be incremented from there. (From OE-Core rev: 9979107d8eaf503efd921564385859b1e83dbb3c) Signed-off-by: Lianhao Lu <lianhao.lu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>