summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/packagedata.py
Commit message (Collapse)AuthorAgeFilesLines
* lib/packagedata.py: Add API to iterate over rprovidesJoshua Watt2023-12-241-0/+15
| | | | | | | | | | Adds an API that makes it easier to iterate over the package data for a all providers of a runtime dependency. (From OE-Core rev: 68bdc219a4a819e83217f5b54c463624af8d3b9e) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/packagedata.py: Fix broken symlinks for providers with a '/'Joshua Watt2023-12-231-2/+2
| | | | | | | | | | | | | If a package had a provider with a '/' in it (e.g. "/bin/sh", "/bin/bash", etc.), the generated symlinks were broken due to being at a hard coded depth. Use oe.path.relsymlink() instead to make a correct relative symbolic link (From OE-Core rev: 8b1482a4e2adb7cf358d638265cf116b34078b84) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package: Move mapping_rename_hook to packagedata function libraryRichard Purdie2023-01-051-1/+9
| | | | | | | | | This function is used by the packaging tasks/classes and makes much more sense in the packagedata function library. (From OE-Core rev: 7a512a8803101310772d83836e6b78ebaf8121de) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package: Move emit_pkgdata to packagedata.pyRichard Purdie2023-01-051-0/+178
| | | | | | | | | Move one of the PACKAGEFUNCS from the package bbclass to packagedata library code for parsing efficiency. (From OE-Core rev: ceba33bf2897f7dd5b1ffe6b742c47bf616243c8) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package: Move pkgdata handling functions to oe.packagedataRichard Purdie2023-01-051-0/+53
| | | | | | | | | To avoid reparsing the bbclass code all the time, move the functions to the packagedata python function library code which is more efficient. (From OE-Core rev: f520a3039540b1183b1b2bdaaf8b9195995c0187) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib: Add copyright statements to files without oneRichard Purdie2022-08-121-0/+2
| | | | | | | | | 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>
* packagedata.py: silence a DeprecationWarningMingli Yu2021-10-131-1/+1
| | | | | | | | | | | | | | | | Use regex strings (rā€™ā€™) to silence below deprecation warning [1]: $ cat tmp/work/intel_x86_64-wrs-linux/linux-yocto/5.10.x+gitAUTOINC+917c420111_373c02c3ca-r0/temp/log.do_deploy [snip] /build/layers/oe-core/meta/lib/oe/packagedata.py:22: DeprecationWarning: invalid escape sequence \s r = re.compile("(^.+?):\s+(.*)") [snip] [1] https://docs.python.org/3/library/re.html (From OE-Core rev: b5b70cba70067466da5e94f69632a2a029203838) Signed-off-by: Mingli Yu <mingli.yu@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/package: Add extended packaged dataJoshua Watt2021-09-031-0/+12
| | | | | | | | | | | | | | | | | | Adds extended package data which is encoded as JSON which allows it to encode more structure than the "flat" package data files. The extended data might be much larger than the standard package data, so it is not read by default and instead requires oe.packagedata.read_subpkgdata_extended() to be called Currently, the file sizes and ELF debug sources are saved off into the extended package data (From OE-Core rev: db9cf430e54ae68da80fbc3fba80ce88d8df164d) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Reviewed-by: Saul Wold <saul.wold@windriver.com> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/packagedata: Fix for new overridesJoshua Watt2021-08-131-3/+3
| | | | | | | | | | | Fix read_subpkgdata_dict to account for the new override operator being ":" instead of "_" (From OE-Core rev: 0b04ae769d4fad2caaa858803d8fbbbaec689541) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* Convert to new override syntaxRichard Purdie2021-08-021-1/+1
| | | | | | | | | | | | This is the result of automated script conversion: scripts/contrib/convert-overrides.py <oe-core directory> converting the metadata to use ":" as the override character instead of "_". (From OE-Core rev: 42344347be29f0997cc2f7636d9603b1fe1875ae) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/packagedata: Use with to control file handle lifetimeOla x Nilsson2019-10-231-3/+2
| | | | | | | (From OE-Core rev: 28b3635b7f40b627a9d6294a78589c78f0c682c8) Signed-off-by: Ola x Nilsson <olani@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta/lib+scripts: Convert to SPDX license headersRichard Purdie2019-05-091-0/+4
| | | | | | | | | | | | | | | | | | | | | | | 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>
* meta: remove True option to getVar callsJoshua Lock2016-12-161-1/+1
| | | | | | | | | | | | | 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>
* classes/lib: Update to explictly create lists where neededRichard Purdie2016-06-021-1/+1
| | | | | | | | | 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>
* classes/lib: Update to use python3 command pipeline decodingRichard Purdie2016-06-021-1/+1
| | | | | | | | | | | In python3, strings are unicode by default. We need to encode/decode from command pipelines and other places where we interface with the real world using the correct locales. This patch updates various call sites to use the correct encoding/decodings. (From OE-Core rev: bb4685af1bffe17b3aa92a6d21398f38a44ea874) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/packagedata: Add import osRichard Purdie2016-04-011-0/+1
| | | | | | | | | So that the packagedata module can be used externally to the core OE environment, add a missing import. (From OE-Core rev: da4df2313c8df92cf321a7631a9a389f895d4615) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake.conf/package: Collapse PKGDATA_DIR into a single machine specific ā†µRichard Purdie2013-09-141-31/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | directory Currently we have a hierarchy of pkgdata directories and the code has to put together a search path and look through each in turn until it finds the data it needs. This has lead to a number of hardcoded paths and file globing which is unpredictable and undesirable. Worse, certain tricks that should be easy like a GL specific package architecture become problematic with the curretn search paths. With the modern sstate code, we can do better and construct a single pkgdata directory for each machine in just the same way as we do for the sysroot. This is already tried and well tested. With such a single directory, all the code that iterated through multiple pkgdata directories and simply be removed and give a significant simplification of the code. Even existing build directories adapt to the change well since the package contents doesn't change, just the location they're installed to and the stamp for them. The only complication is the we need a different shlibs directory for each multilib. These are only used by package.bbclass and the simple fix is to add MLPREFIX to the shlib directory name. This means the multilib packages will repackage and the sstate checksum will change but an existing build directory will adapt to the changes safely. It is close to release however I believe the benefits this patch give us are worth consideration for inclusion and give us more options for dealing with problems like the GL one. It also sets the ground work well for shlibs improvements in 1.6. (From OE-Core rev: 1b8e4abd2d9c0901d38d89d0f944fe1ffd019379) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* class/lib: Fix up various file access methodsRichard Purdie2013-05-091-1/+1
| | | | | | | | | | | | | | 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>
* lib/oe/packagedata: Use the PKGMLTRIPLETS variableRichard Purdie2012-10-221-23/+3
| | | | | | (From OE-Core rev: 26e16a5e5ee1059fb8e55ab915ae9cb8e2b54dcd) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* packagedata/multilib: Fix search patch for multilib buildsRichard Purdie2012-09-261-12/+30
| | | | | | | | | | | The current multilib search path code for packagedata is flawed since it doesn't correctly handle changes in the TARGET_VENDOR/TARGET_OS that multilib may make. This patch enhances the code to correctly build the search paths so multilib packagedata is found correctly. (From OE-Core rev: f50c5d36b2da9b36d56d95a7d89404509a1a3e9b) 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>
* packagedata.py: Fix get_subpkgedata_fn for multilibMatthew McClintock2012-07-091-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | This happens when tryng to add libgcc-dev to as a multilib package (e.g. IMAGE_INSTALL_append = " lib32-libgcc-dev") | Processing task-core-boot... | Processing fman-ucode... | Processing dosfstools... | Processing lib32-libgcc-dev... | Unable to find package lib32-libgcc-dev (libgcc-dev)! NOTE: package fsl-image-full-1.0-r1.1.3.6: task do_rootfs: Failed RPM (or bitbake?) is looking in the tmp/pkgdata, however some of these file paths are mungned for the multilib scenario: $ find tmp/pkgdata/ | grep libgcc-dev$ tmp/pkgdata/ppce5500-fsl-linux/runtime/lib32-libgcc-dev tmp/pkgdata/ppc64e5500-fsl-linux/runtime/libgcc-dev This patch fixes where we look for these files so they can be found and properly installed for the multilib root file system (From OE-Core rev: 4e65ddda5d351bd9f2172e77e656903f61a52f34) Signed-off-by: Matthew McClintock <msm@freescale.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta: Replace bb.data.expand(xxx, d) -> d.expand(xxx)Richard Purdie2012-03-051-6/+6
| | | | | | | | sed \ -e 's:bb.data.\(expand([^,()]*\), *\([^) ]*\) *):\2.\1):g' \ -i `grep -ril bb.data.expand *` Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* packagedata.py: Fix read_subpkgdata_dict()Richard Purdie2011-06-231-0/+2
| | | | | | | | | | If both VAR and VAR_foo are in subd, we need to ensure VAR_foo gets returned. Currently the code would work randomly. The only current user is the rpm packaging backend. (From OE-Core rev: ad098e40e8c57727892819e131bf18308bf244d2) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* packagedata: don't choke on empty PACKAGESChris Larson2011-05-201-1/+2
| | | | | | | (From OE-Core rev: 54ecf8e3992b8a01c2e5bd16720e1819b71b68bd) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* Move packagedata code into oe.packagedata (sync from OE)Chris Larson2011-05-201-0/+106
(From OE-Core rev: e6858627ab087f2f25ebbd6c4422eeae35f3b0ac) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>