summaryrefslogtreecommitdiffstats
path: root/scripts/oe-pkgdata-util
AgeCommit message (Collapse)Author
2022-03-11oe-pkgdata-util: Adapt to the new variable override syntaxPeter Kjellerstedt
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-27buildhistory: Add output file listing package informationAndres Beltran
Currently, buildhistory does not produce a single file combining relevant information of installed packages. Produce an output file "installed-package-info.txt" listing a package's runtime name, buildtime name, its recipe, version, and size to avoid having to look up each package externally. Leave the existing package list files as-is for backwards compatibility. In order to support this efficiently, extend oe-pkgdata-util to accept multiple keys for its read-value argument. Signed-off-by: Andres Beltran <abeltran@linux.microsoft.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-17package/scripts: Fix FILES_INFO handlingRichard Purdie
There is a long standing bug where FILES_INFO isn't written into pkgdata with a package suffix. This means if the files are read into the datastore as intended, the last one "wins". Fix this to work as intended. Most of the call sites using the data need to be updated to handle this and the overrides change correctly. Also fix some other problematic references noticed along the way. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-07-30Convert to new override syntaxRichard Purdie
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 "_". Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-02-10oe-pkgdata-util: Check if environment script is initializedDorinda
Tinfoil doesn't behave well if environment is not initialized, this check ensures a proper error log if environment is not initialized. [YOCTO #12096] Signed-off-by: Dorinda Bassey <dorindabassey@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-11-04scripts/oe-pkgdata-util: Enable list-pkgs to print ordered packagesYeoh Ee Peng
The list-pkgs currently print packages in unordered format. Enable list-pkgs to print ordered packages that will ease viewing. Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-09-05oe-pkgdata-util: add option for lookup-recipe to not fatally failRoss Burton
It is often useful to run lookup-recipe on a list of packages and get notifications that there were failures, instead of a fatal error on the first failure. This makes it possible to pass long lists of packages to oe-pkgdata-util and process the output. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-04oe-pkgdata-util: package-info: Re-add support for the --extra optionPeter Kjellerstedt
Commit 64d3ce83 broke the --extra option. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-04oe-pkgdata-util: Make parse_pkgdatafile() support package suffixed varsPeter Kjellerstedt
Support for variables suffixed with package names, e.g., PKGV_foo, was removed in commit 3d2c87c4, which broke support for recipes that set other versions on their packages than what is in ${PV}. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-05-22oe-pkgdata-util: lookup-recipe, package-info: Don't finish prematurelyPeter Kjellerstedt
If a package name exists in runtime-rprovides, lookup-recipe and package-info would finish after printing information about that package even if more packages were specified. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-02-16oe-pkgdata-util: add --long option to list-pkg-files to show sizesRoss Burton
Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-01-29oe-pkgdata-util: Include colon when searching for variablesAmanda Brindle
When searching for variables, include colon to ensure the script doesn't find a variable that starts with the same name. Signed-off-by: Amanda Brindle <amanda.r.brindle@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-01-22oe-pkgdata-util: Add support for RPROVIDESAmanda Brindle
In lookup_recipe, package_info, and list_pkg_files, check if the package name exists in runtime-rprovides. If so, and the provider package has a different name than the inputted package, print a note that says the specified package is in another package's RPROVIDES. If the provider package has the same name as the inputted package, continue as before. Fixes [YOCTO 11943] Signed-off-by: Amanda Brindle <amanda.r.brindle@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-01-22oe-pkgdata-util: Refactor functions for consistencyAmanda Brindle
Refactor functions lookup_recipe and package_info to be consistent with list_pkg_files. Print the appropriate information as soon as it's found, rather than storing it in a mappings variable and wait to print after searching all packages. Signed-off-by: Amanda Brindle <amanda.r.brindle@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-10-06oe-pkgdata-util: add unescape option to read-valueRoss Burton
Some fields are multiline values which have been escaped, so add an option to unescape the \n and \t. Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-07-21oe-pkgdata-util: Setup logging before calling prepareRichard Purdie
This avoids test failures like: INFO - ====================================================================== INFO - FAIL [1.046s]: test_find_path (pkgdata.OePkgdataUtilTests) INFO - ---------------------------------------------------------------------- INFO - Traceback (most recent call last): File "/media/build1/poky/meta/lib/oeqa/core/decorator/__init__.py", line 32, in wrapped_f return func(*args, **kwargs) File "/media/build1/poky/meta/lib/oeqa/selftest/cases/pkgdata.py", line 50, in test_find_path self.assertEqual(result.output, 'zlib: /lib/libz.so.1') AssertionError: 'NOTE: Starting bitbake server...\nzlib: /lib/libz.so.1' != 'zlib: /lib/libz.so.1' - NOTE: Starting bitbake server... zlib: /lib/libz.so.1 INFO - ---------------------------------------------------------------------- since there is corruption in the output. Setting the logging up before calling tinfoil.prepare() resolves this. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-06oe-pkgdata-util: package-info: Allow extra variables to be displayedPeter Kjellerstedt
By specifying the -e <var> option one or multiple times, extra variables available in the pkgdata can be displayed, e.,g, `oe-pkgdata-util package-info -e SUMMARY -e LICENSE ...`. The extra variables displayed are quoted since some of them may contain whitespace. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-16scripts: 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: Ross Burton <ross.burton@intel.com>
2016-12-14oe-pkgdata-util: Make read-value handle override variablesOla x Nilsson
Some variables in pkgdata files have a package-name override. When the bare variable can not be found, try with the override-variant. PKGSIZE is one such variable, and already had special code to handle this. Test included. Signed-off-by: Ola x Nilsson <ola.x.nilsson@axis.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-11-06oe-pkgdata-util: Use standard verb form in help info.Robert P. J. Day
"Shows" -> "Show", to be consistent with standard form of help output. Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-09-03scripts: ensure tinfoil is shut down correctlyPaul Eggleton
We should always shut down tinfoil when we're finished with it, either by explicitly calling the shutdown() method or by using it as a context manager ("with ..."). Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-12oe-pkgdata-util: new option to provide full info for binary package(s)Alexander D. Kanevskiy
New option can be used for displaying full information about binary package(s), including name, full version, recipe name, recipe full version and package size. This information can be useful inside custom buildhistory class to produce detailed image manifest for further analysis. List of packages can be specified as command line arguments or can be read from file (e.g. from existing image manifest). Warning: In case of image manifest is used as input outside of build process, be aware that pkgdata might change since the time image was built. Output format: {PKG} [PKGE:]{PKGV}[-{PKGR}] {PN} [PE:]{PV}[-{PR}] {PKGSIZE} Signed-off-by: Alexander D. Kanevskiy <kad@kad.name> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-06-07oe-pkgdata-util: fix AttributeErrorEd Bartosh
The default arparse behaviour in Python 2 and early versions of Python 3 was to print usage message if no subcommands provided by user. In Python >= 3.2.3 subparser has to have attribute 'required' set to True to behave similar way. By default subparser.required attribute is set to False, usage message is not printed and code continues to be executed. oe-pkgdata-util code raises AttributeError exception in this case: AttributeError: 'Namespace' object has no attribute 'func' Fixed this by setting subparser.required to True. [YOCTO #9711] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02scripts: python3: convert iterables to listsEd Bartosh
Converted return value of items() keys() and values() to lists when dictionary is modified in the loop and when the result is added to the list. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02scripts: use python3 in shebangEd Bartosh
As most of oe-test cases work for devtool and recipetool it makes sense to switch both tools to python 3 by explicitly referring to python3 in their shebangs. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2016-04-04classes/buildhistory: optimise getting package size listPaul Eggleton
Invoking oe-pkgdata-util in turn for every package in the list was slow with a large image. Modify oe-pkgdata-util's read-value command to take an option to read the list of packages from a file, as well as prefix the value with the package name; we can then use this to get all of the package sizes at once. This reduces the time to gather this information from minutes to just a second or two. Fixes [YOCTO #7339]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-22scripts: print usage in argparse-using scripts when a command-line error occursPaul Eggleton
For scripts that use Python's standard argparse module to parse command-line arguments, create a subclass which will show the usage the usage information when a command-line parsing error occurs. The most common case would be when the script is run with no arguments; at least then the user immediately gets to see what arguments they might need to pass instead of just an error message. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-08scripts/oe-pkgdata-util: sort the packages in list-pkg-filesRoss Burton
Sort the list of packages in list-pkg-files to make the output easier to read. Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-10-24scripts/oe-pkgdata-util: Fix variable name in error handlingRichard Purdie
Fix: logger.error('Unable to find pkgdata directory %s' % pkgdata_dir) NameError: global name 'pkgdata_dir' is not defined Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-09-24oe-pkgdata-util: avoid returning skipped packagesRobert Yang
The skipped packages may be pulled in by another package, for example, when libc6-dbg is already installed and should be skipped, but it would be pulled in by libsegfault, this patch fixes the issue. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-17lib/oe/package_manager: support exclusion from complementary glob process by ↵Paul Eggleton
regex Sometimes you do not want certain packages to be installed when installing complementary packages, e.g. when using dev-pkgs in IMAGE_FEATURES you may not want to install all packages from a particular multilib. This introduces a new PACKAGE_EXCLUDE_COMPLEMENTARY variable to allow specifying regexes to match packages to exclude. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-14oe-pkgdata-util: add list-pkg-files subcommandPaul Eggleton
Adds a subcommand to list the files in a package, or list the files in all packages for a recipe. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2015-02-14oe-pkgdata-util: add list-pkgs subcommandPaul Eggleton
Add a subcommand to list packages, with options to list packages matching a specification, and packages produced by a particular recipe. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2015-02-14oe-pkgdata-util: allow reverse package name lookupsPaul Eggleton
Add a -r/--reverse option to the lookup-pkg subcommand to enable looking up the recipe-space package name for one or more runtime package names. Also make this subcommand into a function that can be reused elsewhere. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2015-02-14oe-pkgdata-util: fix read-value to handle data with colons in the valuePaul Eggleton
The read-value subcommand was truncating the value if it contained colons, for example FILES_INFO. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2015-02-14oe-pkgdata-util: make find-path show a proper error if no package foundPaul Eggleton
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2015-02-14oe-pkgdata-util: improve command-line usagePaul Eggleton
* Use argparse instead of optparse for standardised help output, options and a much cleaner code structure * Look up pkgdata directory automatically so the user doesn't have to specify it * Use standard logging NOTE: this does mean a slight change in syntax - if you do want to specify the pkgdata directory (usually only necessary if you're calling it from within the build process) you need to use the parameter -p (or --pkgdata-dir) and specify this before the command, not after it. Examples: oe-pkgdata-util find-path /sbin/mke2fs oe-pkgdata-util lookup-recipe libelf1 oe-pkgdata-util read-value PKGSIZE libc6 oe-pkgdata-util -p /home/user/oe/build/tmp/sysroots/qemux86-64/pkgdata read-value PKGSIZE libc6 Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2014-06-25oe-pkgdata-util: fix help textPaul Eggleton
This was copy/pasted from another script and not corrected. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-12-03classes/package: record PKGSIZE as total file size in pkgdataPaul Eggleton
We were using "du -sk" to collect the total size of all files in each package for writing out to PKGSIZE in each pkgdata file; however this reports the total space used on disk not the total size of all files, which means it is dependent on the block size and filesystem being used for TMPDIR on the build host. Instead, take the total of the size reported by lstat() for each packaged file, which we are already collecting for FILES_INFO in any case. Note: this changes PKGSIZE to be reported in bytes instead of kilobytes since this is what lstat reports, but this is really what we should be storing anyway so that we have the precision if we need it. Fixes [YOCTO #5334] Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-03classes/package: fix FILES_INFO serialisation in pkgdataPaul Eggleton
The FILES_INFO entry in each pkgdata file stores the list of files for each package. Make the following improvements to how this is stored: * Store paths as they would be seen on the target rather than erroneously including the full path to PKGDEST (which is specific to the build host the package was built on) * For simplicity when loading the data, store complete paths for each entry instead of trying to break off the first part and use it as the dict key * Record sizes for each file (as needed by Toaster) * Serialise the value explicitly using json rather than just passing it through str(). Fixes [YOCTO #5443]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-29scripts/oe-pkgdata-util: fix global name 'debug' is not definedPaul Eggleton
This global variable is no longer present, so pass in the value specified via the command line. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-28scripts/oe-pkgdata-util: add ability to find a recipe from a target packagePaul Eggleton
Add a "lookup-recipe" command to show which recipe produced a particular package. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-10-28scripts/oe-pkgdata-util: add ability to look up runtime package namesPaul Eggleton
Add a "lookup-pkg" command to oe-pkgdata-util that can be used to find the runtime name of a package (after e.g. Debian library package renaming). Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-10-28scripts/oe-pkgdata-util: add ability to search for a target pathPaul Eggleton
Add ability to search for a target path in produced packages, in order to find which package provides a specific file. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-10-28scripts/oe-pkgdata-util: check path arguments to ensure they existPaul Eggleton
Show an error if the specified paths don't exist. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-10-28scripts/oe-pkgdata-util: improve help text and command line parsingPaul Eggleton
* Use optparse to parse command line * Make help text actually helpful by describing what each command does * Drop comment at the top listing the commands which is now superfluous Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-10-28scripts/oe-pkgdata-util: remove remnants of former pkgdata structurePaul Eggleton
OE-Core commit 1b8e4abd2d9c0901d38d89d0f944fe1ffd019379 removed the vendor-os argument from the command line, and the code using the package architectures, so clean these items up. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-09-13bitbake.conf/package: Collapse PKGDATA_DIR into a single machine specific ↵Richard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-16classes/buildhistory: record size of installed package not compressed archiveMartin Jansa
* usually it's more important to know how much space will each package take on target device then size of compressed package * example for libewebkit0 with 4 different architectures, interesting that om_gta02 .ipk is bigger but it's smaller when installed before: MACHINE DEFAULTTUNE SIZE (.ipk file) om_gta04 cortexa8t-neon 15996 KiB libewebkit0 qemux86_64 x86-64 16992 KiB libewebkit0 spitz xscale 16148 KiB libewebkit0 om_gta02 arm920t 16260 KiB libewebkit0 after: MACHINE DEFAULTTUNE SIZE (installed) om_gta04 cortexa8t-neon 60544 KiB libewebkit0 qemux86_64 x86-64 63720 KiB libewebkit0 spitz xscale 60588 KiB libewebkit0 om_gta02 arm920t 56268 KiB libewebkit0 Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>