summaryrefslogtreecommitdiffstats
path: root/meta/classes/package.bbclass
AgeCommit message (Collapse)Author
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-09sanity/patch.py: Remove commands module usageRichard Purdie
The commands module is removed in python3. Use the subprocess module instead and the pipes module to replace the mkargs usage. 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-22package.bbclass: ensure license excluded files aren't packagedChristopher Larson
An excluded package left its files behind, which meant they could end up in another package instead, meaning we could ship GPLv3 binaries even with GPLv3 in INCOMPATIBLE_LICENSE. Skip the files belonging to the excluded packages to prevent this from occurring. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-04-22package.bbclass: add LICENSE_EXCLUSION to vardepsChristopher Larson
Ensure that changes to INCOMPATIBLE_LICENSE re-run do_package for affected recipes. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-04-18package.bbclass: Add useradd variables to PACKAGEVARSRichard Purdie
THe USERADD_PARAMS and similar group variables are package specific variables which should get added to the vardeps of the packaging process. This change also ensures they get remapped correctly by the multilib code. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-17package.bbclass: Fix populate_packages for glob expansion issuesRichard Purdie
If we put a valid glob like "*/foo/*" into FILES, populate_packages breaks with a "file exists" message. This is because the glob expansion does not have "./" prefix however there may already be an entry in the seen list which does have such a prefix. The easiest/simplest fix right now is to add the prefix if it doesn't exist which only happens for certain globs. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-13package/image.bbclass: Fix multilib rprovidesRichard Purdie
allarch multilib recipes are meant to provide a list of different multilib variants. Unfortunately since the pkgdata also has mappings for these, they get mapped back to the original package name which means the effect is undone at package creation time when the remapping code is called. This patch adds in a conditional to break that chain meaning the packages get the correct RPROVIDES and image builds work correctly with opkg. [YOCTO #3453] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-04Add file information to package information windowAndrei Dinu
Removed the package files parsing routine from the packageinfo.bbclass file and added it to the package.bbclass file. Signed-off-by: Andrei Dinu <andrei.adrianx.dinu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-26package.bbclass: Correctly handle /usr/src/debug file ownershipRichard Purdie
After the recent cached path operation improvements, we need to tell the cache about directory changes. /usr/src/debug was was cached as not created and this was leading to bugs in file ownership. This change updates the cache and avoids this issue. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-25package.bbclass: Ensure debug source file is generated correctlyRichard Purdie
The command for generating debug sources appends to the file, therefore we need to ensure it does not exist before we run the command else we end up doing more work that we should have to. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-25package.bbclass: Handle subprocess errors correctlyRichard Purdie
If an error occurs in subprocess.call() we currently don't catch it. In particular we have issues where debugedit is segfaulting unnoticed. This fixes up various code paths to catch the errors. [YOCTO #4089] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-18package: Add cachedpath optimisationRichard Purdie
Currently, various standard library operations like os.walk(), os.path.isdir() and os.path.islink() each call stat or lstat which involves a syscall into the kernel. There is no caching since they could conceivably have changed on disk. The result is that for something like the do_package task of the kernel we're spending over two minutes making 868,000 individual stat calls for 23,000 files. This is suboptimal. This patch adds lib/oe/cachedpath.py which are a set of replacement functions for these operations which use cached stat data rather than hitting the kernel each time. It gives a nice performance improvement halving the build time of the kernel do_package. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-15package.bbclass: add debug-without-src PACKAGE_DEBUG_SPLIT_STYLEMartin Jansa
* same as original and default version, but does not package source files in PN-dbg Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-03-05package.bbclass: Ensure all .so files get strippedRichard Purdie
It was realised that .so files which were not marked as executable were not gettings stripped. This was wasting space in images. This patch ensures they do get processed by the code correctly. [YOCTO #3973] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-05package.bbclass: Fix do_package variable dependenciesRichard Purdie
When the do_package function was split into different sections, the vardeps were not updated to match meaning some function changes weren't reflected in the sstate checksums. Fix this. [YOCTO #3980] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-22pakcage.bbclass:use a better way to cut -dev/-dbg suffixSong.Li
In pakcage.bbclass,function replace('-dev', '') is used to cut '-dev' suffix. but it will cause the name "lib32-device-dev" to "lib32ice", so change it to [:-4]. Signed-off-by: Song.Li <Song.Li@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-17classes: Drop none package specific packaging variable accessesRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-11package.bbclass: support dangling path componentsEnrico Scholz
Commit ec2aab09769f4b6817d74d2175afa2b7c7598750 introduced a regression on packages which contain symlinks with unresolvable path components (e.g. lsof-dbg). While assigning a variable, an exception was raised and the exception handler accessed this variable. Patch deals both with the dangling path components by assuming them as valid directories and by avoiding the broken assignment. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-11package.bbclass: use oe.path.realpath()Enrico Scholz
oe.path.realpath() provides are common and more correct implementation for resolving symlinks within sysroot. Use it. Old implementation suffered from lot of problems; e.g. * redundant code * calls 'os.stat()' which references files on host; this can give wrong results about existing/non-existing and can cause EPERM (instead of the catched ENONENT) exceptions * does not deal with special cases like '..' leaving the sysroot. Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06package.bbclass: Replace undefined 'src' with valid variableKhem Raj
After rewrite of split_and_strip_files src var is no longer available here where it is used so we should replace it with a valid value Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06package.bbclass: Ensure package_get_auto_pr is run at the correct pointRichard Purdie
This needs to run before PKGR and other variables using PRAUTO are used, including the expansion optimisations. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06package.bbclass: return list of packages created in do_split_packagesMartin Jansa
* sometimes it's useful to do something with packages created by do_split_packages later in do_package_prepend, e.g. in: http://lists.linuxtogo.org/pipermail/openembedded-devel/2013-February/043824.html I have .bbclass which adds some postinst, postrm and RDEPENDS, but ttf-mplus is using do_split_packages to create those packages Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06package.bbclass: Pre-expand some variables to save timeRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06package.bbclass: Better document the different phases of operationRichard Purdie
Add headers to document the different phases of do_package and make the steps clearer. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06package.bbclass: Add PACKAGESPLITFUNCS variableRichard Purdie
Prepending to populate_packages is rather ugly and means its hard to trace errors and also profiling informaiton is summed together in one function. This patch starts to split out the prepends to become separate functions to avoid these issues. This is generally a neater way to write functions than prepending to where there can sometimes be variable scope issues and we've been bitten by whitespace issues in the past. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06package.bbclass: Simplify empty directory removalRichard Purdie
Rather than an exec() per directory, we might as well exec one command and be done with it. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06package.bbclass: Various minor performance tweaksRichard Purdie
* Call getVar outside the loop * Drop unneeded PATH export (bitbake does this already) * Drop unused variable * Simplify if statement nesting * Simplify variable expandion to a getVar call (expand would just call getVar) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06package.bbclass: Make use of cleandirs and dirs function flagsRichard Purdie
We can use the cleandirs and dirs flags for the fuctions to handle directory cleaning and creation at the bitbake level rather than using these calls within the functions Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06package.bbclass: Rewrite split_and_strip_filesRichard Purdie
The split_and_strip_files funciton was hard to follow and its usage of prefixes to strings was unusual. This rewrites it to use a list of hardlinks, symlinks and elffiles where each list is iterated over at the correct point. This means we can avoid creating dandling symlinks for example so we can simply delete the cleanup code for this. The isfile() check is also removed which gives a significant improvement in speed. Its uneeded since os.walk will have already checked things in files are files. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06package.bbclass: Fix up bb.mkdirhier/bb.copyfile usageRichard Purdie
These are in bb.utils so lets the correct function and avoid the overhead of the fixup/warning for the deprecated usage. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06package.bbclass: use the multiprocess pool from bitbakeRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06package: Process package stripping in parallelRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06package: Don't export PATHRichard Purdie
PATH is already exported, we don't need to do this each time we run something, its just noise and overhead. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06package.bbclass: Multithread per file dependency generation codeRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-04package.bbclass: Allow per-package SKIP_FILEDEPSPeter Seebach
The existing check for SKIP_FILEDEPS can be overridden per recipe using SKIP_FILEDEPS_pn-${PN}. However, there's no mechanism for letting a single package within a recipe use SKIP_FILEDEPS. This patch adds SKIP_FILEDEPS_<pkg>, by analogy to FILES_<pkg>. Note that it only works one way; if the recipe has SKIP_FILEDEPS = 1, the checks for individual packages will never be reached. Signed-off-by: Peter Seebach <peter.seebach@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-02-01package.bbclass: Use expanded RDEPENDS in read_shlibdepsRichard Purdie
We may as well expand the RDEPENDS when reading and writing as this function does. if we don't do this, we could accidentally duplicate data and it also turns out to be much less efficient. (From OE-Core rev: d62a3151e7b252911c172a605b3089de355663c5) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-01package: Create global package file list and use throughout PACKAGEFUNCSRichard Purdie
Currently we do a signficant amount of tree traversal in many different places which in inefficient. We can assume that the files don't change and cache the file list which gives an efficiency improvement which this patch does using a global variable. (From OE-Core rev: 2d7608842d2dab07065e60aab729a5c8fd6b7907) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-01package.bbclass: Improve package_fixsymlinksRichard Purdie
Improve package_fixsymlinks so we don't handle RDEPENDS for every single package in PACKAGES. (From OE-Core rev: 20ff8feb95d54e4db646f8c0cb006ce187e288af) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-01package.bbclass: Tweak PACKAGEFUNCSRichard Purdie
Move package_rename_hook call into PACKAGEFUNCS and also move package_get_auto_pr to a more appropriate execution point, grouping package metadata handling functions together. (From OE-Core rev: a3f41cfbc8923e54198d10db292a11ef2edda4d7) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-01package.bbclass: Split out package_fixsymlinks functionRichard Purdie
The symlink handling code doesn't need to being part of populate_packages and is logically separate so split it out into a separate function, package_fixsymlinks. (From OE-Core rev: fc964ed2b558b08327e2bc8c93ada80ca9d97337) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-01package.bbclass: Move PKG handling code to emit_pkgdataRichard Purdie
We only use the PKG variable in emit_pkgdata so we might as well move the fallback code there, allowing restructuring of other parts of the metadata. (From OE-Core rev: 0136ae9a5f719f0e7ba6e00bfd366c0e61b3b3f2) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-01package.bbclass: Avoid copying the datastore for FILES handlingRichard Purdie
There is no real point in adjusting overrides and creating a copy of the datastore, just to access a single variable. We can do this just as easily with a slightly more complicated getVar call. This improves performance. (From OE-Core rev: 69f4351809359a0c7c38e8f233f3e3f7680ed2e2) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-01package.bbclass: Check FILES once, not once per loop iterationRichard Purdie
There is no need to check FILES in each loop iteration, we can just check it once at the start when we read the variable. (From OE-Core rev: 1bcc5cba12cbb1b846b433719d1b0820f5a97105) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-01package.bbclass: Add a shortcut exit from the mkdir functionRichard Purdie
The mkdir function iterates over strings with many different operations, even if ultimately the target already exists. This adds a check to the start of the function so we don't waste time when the target already exists. (From OE-Core rev: 06e188e673313f1eb9ae7d85ae64467c8d2a94b3) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-01package.bbclass: Improve kernel module handlingRichard Purdie
Currently the kernel module handling consists of several special cases and has its own path walking. This refactors the code to handle them in a more standardised way which is also a bit more efficient. (From OE-Core rev: ad51b54f0afe8c56033137b7cf9ba398877b2651) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-01package: Rename splitfile functions to something more descriptiveRichard Purdie
The splitfile and splitfile2 function names are confusing and the comments are also misleading, hard to understand or plain incorrect. This tries to improve things. (From OE-Core rev: 46f3050a1f46f814e2d031e7e71600b2932d631c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-28package.bbclass: remove RRECOMMENDS on base packages for locale packagesAndreas Müller
As long as we support only one locale package per recipe this leads to unwanted packages in images. This patch was motivated by samba (meta-oe): only wanting libsmbclient one gets full samba server into the image. For my standard image the follwing package were removed by this patch: -acl_2.2.51-r3_armv7a-vfp-neon.ipk -alsa-states_0.2.0-r3_armv7a-vfp-neon.ipk -alsa-utils_1.0.25-r3_armv7a-vfp-neon.ipk -alsa-utils-aconnect_1.0.25-r3_armv7a-vfp-neon.ipk -alsa-utils-alsaconf_1.0.25-r3_armv7a-vfp-neon.ipk -alsa-utils-alsactl_1.0.25-r3_armv7a-vfp-neon.ipk -alsa-utils-alsaloop_1.0.25-r3_armv7a-vfp-neon.ipk alsa-utils-alsamixer_1.0.25-r3_armv7a-vfp-neon.ipk -alsa-utils-alsaucm_1.0.25-r3_armv7a-vfp-neon.ipk -alsa-utils-amixer_1.0.25-r3_armv7a-vfp-neon.ipk -alsa-utils-aplay_1.0.25-r3_armv7a-vfp-neon.ipk -alsa-utils-aseqdump_1.0.25-r3_armv7a-vfp-neon.ipk -alsa-utils-aseqnet_1.0.25-r3_armv7a-vfp-neon.ipk -alsa-utils-iecset_1.0.25-r3_armv7a-vfp-neon.ipk -alsa-utils-midi_1.0.25-r3_armv7a-vfp-neon.ipk -alsa-utils-speakertest_1.0.25-r3_armv7a-vfp-neon.ipk -attr_2.4.46-r4_armv7a-vfp-neon.ipk -avahi_0.6.31-r7.1_armv7a-vfp-neon.ipk -gtk-engines_2.20.2-r3_armv7a-vfp-neon.ipk -pulseaudio_2.1-r15_armv7a-vfp-neon.ipk -samba_3.6.8-r6_armv7a-vfp-neon.ipk -vte_0.28.2-r5_armv7a-vfp-neon.ipk -xz_5.1.2alpha-r0_armv7a-vfp-neon.ipk Strange effect: For samba buildhistory's depends.dot says: -samba -> libc6; -samba -> libgcc1; -samba -> libreadline6; -samba -> libtalloc2; -samba -> libtdb1; -samba -> libwbclient0; -samba -> libz1; -samba -> update_rc_d; -samba_locale_de -> samba [style=dotted]; samba_locale_de -> virtual_locale_de [style=dotted]; -samba_locale_fr -> samba [style=dotted]; -samba_locale_fr -> samba [style=dotted]; This is conflicts to buildhistory's result on samba package not mentioning any changes for samba package. Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-01-25Split do_packagedata task from do_packageRichard Purdie
Currently, do_rootfs has a dependency on all the do_package output being present due to its usage of the pkgdata directories. This means that if you run: bitbake xxxx-image -c rootfs you end up having to fetch and unpack all the do_package data which is usually large and inefficient. It also means rm_work has to leave all the do_package data lying around so rootfs works. This patch splits the actual creation of the pkgdata directory off into a separate task, "packagedata" which happens immediately after do_package. We can then remap the dependencies so this task is depended upon, not do_package. Sstate can then be programmed not to require do_package at the appropriate times. Whilst this patch doesn't do so, it opens the possibility of rm_work wiping out the do_package output from WORKDIR as long as it also removed the do_package stamp (both normal and setscene variants) and allowing more space savings with rm_work which has been regularly requested. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>