Commit Graph

330 Commits

Author SHA1 Message Date
Joshua Lock c4e2c59088 meta: remove True option to getVar calls
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-12-16 10:23:23 +00:00
Ulf Magnusson 4dbb0d73dd package.bbclass: Use bb.fatal() instead of raising FuncFailed
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.

Motivating quote below:

< kergoth> the *original* intent was for the function/task to error via
           whatever appropriate means, bb.fatal, whatever, and
           funcfailed was what you'd catch if you were calling
           exec_func/exec_task. that is, it's what those functions
           raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself

FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.

(From OE-Core rev: 8443b6f3f25181f5ac49bc25a1387cd05b814376)

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-04 16:29:05 +01:00
Robert Yang 02e6c1e520 meta: cleanup d.getVar(var, 0)
(From OE-Core rev: 33b0d940b09a5ce1462476614213a58d3d62e80d)

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>
2016-09-14 22:22:07 +01:00
Vladimir Zapolskiy 6f2fa0a018 package: correct subprocess.Popen.communicate() return values
This is a non-functional change, which intends to correct element
names of a tuple returned by Popen.communicate().

Both in python2 and python3 subprocess.Popen.communicate() method
returns a tuple (stdoutdata, stderrdata), thus old assignments and
collateral comments are incorrect from human's point of view, however
formally there is no error in the code.

The change is desired to have to avoid copy-paste errors in future.

(From OE-Core rev: cdd9bae381deb15ac84e11a39f9d72f2757c1583)

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:33 +01:00
Markus Lehtonen 7633b81aac package.bbclass: warn about files under symlinked directories
[YOCTO #9827]

(From OE-Core rev: 27b285bd641d62f65154e6deec5146c0c8bb1458)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:31 +01:00
Markus Lehtonen 961b5269cd package.bbclass: better handling of middle-path dir symlinks
For example in a directory structure like this
    .
    ├── symlink -> foo/bar
    └── foo
        └── bar
            └── file
'file' could be referenced by specifying e.g. 'foo/bar/file' or
'symlink/file'.  In cases like this populate_packages() might crash if
the file was referenced (in FILES) via the symlinked directory. The
outcome depends on how the user defined FILES_pn.  This patch should
make the function behave more consistently. It looks for files which are
referenced via symlinked directories and handles them separately,
failing if their parent directory is a non-existent path. For example,
defining FILES_{PN} = "symlink/file" causes a build failure because
symlinks target 'foo/bar' is not included at all.

[YOCTO #9827]

(From OE-Core rev: 29d1738329ddf4e63844a9ad1158a1d41e2ee343)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:31 +01:00
Robert Yang 8efd482911 package.bbclass: remove unneeded chmod() and chown()
* The mode and owner info are saved in inode, hardlink won't change them,
so remove unneeded chmod() and chown().

* This can avoid the problem that when do_package re-run, the file's mode
maybe different if it is 0444 (changed to 0644 when re-run), this is
caused by pseudo adds 'w' on real file, and doesn't track linked source
when hard link, Peter and Mark may fix pseudo, but the removed code is not
needed, which can avoid the problem.

* To reproduce the problem, for example, version.c from gzip's ${B}:
1) bitbake gzip
2) Edit rpm-native or package.bbclass to make do_package re-run.
3) bitbake gzip
After the first build, build/version.c in gzip-dbg is 0444, but after
the second build, it will be 0644, this because do_package does:
$ ln ${B}/version.c gzip-dbg/version.c,
$ chmod 0444 gzip-dbg/version.c (it runs chmod 0644 on the real filesystem)
And in the second build, the gzip-dbg/version.c will be removed and
created again, so that stat() can't get 0444 but 0644 since
${B}/version.c is not tracked by pseudo.

(From OE-Core rev: 26ab4b431da0c00010e8d399f890c5fbf0b03c94)

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>
2016-08-10 10:46:30 +01:00
Ross Burton 70d63061f3 classes/package: save/restore cwd in split_and_strip_files
This function uses chdir() heavily, so save and restore the cwd so that it
doesn't affect the system state.

(From OE-Core rev: d3059e5d35dcb01641e828c5182615b8fbf1f2e5)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 18:11:10 +01:00
Richard Purdie 44e9a0d2fa classes/lib: Update to explictly create lists where needed
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-06-02 08:24:00 +01:00
Richard Purdie a7309d5790 classes/lib: Update to use python3 command pipeline decoding
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>
2016-06-02 08:24:00 +01:00
Stephano Cetola af587b86f5 package.bbclass: fix strip and split logic
In order for strip and split to work together, we need to populate the
data structors if either split OR strip are not inhibited.

Original behaviour:

INHIBIT_PACKAGE_STRIP: no strip, no debug split
INHIBIT_PACKAGE_DEBUG_SPLIT: strip, no split

Behaviour after this patch:

INHIBIT_PACKAGE_STRIP: no strip, debug split
INHIBIT_PACKAGE_DEBUG_SPLIT: strip, no split
BOTH: no strip, no split, DNP data structures

(From OE-Core rev: 0df6dabdf0a61ae7b99c6a792f1eec754a7b23bd)

Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-01 12:38:43 +01:00
Ross Burton f095fdc408 package: ensure do_split_packages doesn't return duplicates
do_split_package() constructs a list of packages that were created as it
iterates through the files, so if multiple files go into the same package then
the package will be repeated in the output.

Solve this by using a set() to store the created packages so that duplicates are
ignored.

(From OE-Core rev: b251f8b212f16b16b88183cc9a959d8cfa24fe3c)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-29 07:58:43 +01:00
Dan McGregor 83eac650fd package.bbclass: improve permission handling
Change fs_link_table to be keyed by path, just like fs_perms_table.
When a new entry is coming in for either table, remove any previous
entry for that path. This way later permission file entries override
earlier ones.

[YOCTO #9430]

(From OE-Core rev: b7504ece784fad997e72f4cd89cdf73f24901541)

Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-14 10:58:34 +01:00
Bill Randle 9262d2ff39 package.bbclass: handle links in sorted order
When processing links, the directories are processed in unsorted order
which can result in cases like /var/lock -> /run/lock handled before
/var/run -> /run throwing an error for /var/run because /run already exists.
Change the link processing to ensure links are processed in sorted order of
the destination.

[YOCTO #9430]

(From OE-Core rev: d71f4f54b4c22c9382bddce66c1580d875dcfef2)

Signed-off-by: Bill Randle <william.c.randle@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-13 10:12:52 +01:00
Ross Burton 37f4f5b8c7 package: do_split_packages: expand variables in extra_depends
If a recipe passes for example extra_depends="${PN}-dev" to do_split_packages()
then it isn't expanded, so the check for the multilib prefix doesn't work.
Solve this centrally by expanding extra_depends inside do_split_packages().

[ YOCTO #9381 ]

(From OE-Core rev: d3875a8111f1d88dcc83219d4700784050988ca3)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 10:29:23 +01:00
Hongxu Jia 55cd35bd18 conf/bitbake.conf package.bbclass: fix dbg package not contain sources while -fdebug-prefix-map used
Tweak DEBUG_FLAGS to use "/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}"
as source target path in DWARF. While use gdb to debug binary, it could
work with sources in dbg package.

While -fdebug-prefix-map is used for compiling, we do not need invoking
debugedit to edit DWARF at do_package time, but list where sources files
are.

The copydebugsources uses the list to copy sources to dbg package. It
works whether -fdebug-prefix-map used or not.

[YOCTO #9305]

(From OE-Core rev: ecb56a6ae0c870af680da03db9d39703b525fc98)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-28 15:55:51 +01:00
Brendan Le Foll 959b7f204e package.bbclass: Treat .node files same as .so when checking what to strip
Typically in a node/npm compiled modules the module is named .node. This is a
binary module without a wrapper so it can actually be relatively large if
unstripped.

(From OE-Core rev: d14bc2667575bc0e29b9e90d80c01703639b76f1)

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-25 10:29:16 +00:00
Ross Burton 604dc1c3e6 package: check inherit instead of PN to decide if a recipe is a packagegroup
(From OE-Core rev: b6c3ea4240e965f69b3cae0b601c8dc8d18c7646)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-28 11:32:57 +00:00
Richard Purdie 7fa6eeba1c classes/lib: Add expand parameter to getVarFlag
This sets the scene for removing the default False for expansion
from getVarFlag. This would later allow True to become the default.

On the most part this is an automatic translation with:

sed -e 's:\(\.getVarFlag([^,()]*, [^,()]*\)):\1, True):g'  -i `grep -ril getVar *`

In this case, the default was False, but True was used since in most
cases here expansion would be expected.

(From OE-Core rev: 42a10788e89b07b14a150ced07113566cf99fcdd)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-04 23:39:00 +00:00
Richard Purdie 4ea6a647df package.bbclass: Add data expansion to do_split_packages()
do_split_packages is often called with parameters which need expansion.
This happens to work at the moment since python functions are expanded
before execution but likely will not happen in future and isn't good
code practise.

Expand the common parameters do_split_packages() to avoid regressions.

(From OE-Core rev: c92ac7996b1b65a9171ea00e7156c87cccc07cec)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-04 23:39:00 +00:00
Richard Purdie ea29bec6c7 insane/package: Fix cases where QA errors aren't fatal
When using package_qa_handle_error(), we need to check QA_SANE and
give a fatal error if issues were raised. The main insane checks do
this, the anonymous python in insane does not, nor does the code in
package.bbclass. This was likely missed when the function was
introduced to package.bbclass.

The impact is that errors can be shown but don't stop the build
(do_package succeeds), the initial build fails due to the errors
shown but subsequent builds succeed. This is clearly broken.

The solution is to check QA_SANE in places we use the handle_error
function.

[YOCTO #8907]

(From OE-Core rev: 7e36d13212763fe409747aba011c020c9aeba6d7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 11:54:51 +00:00
Richard Purdie b7766e4bbe package: Add auto package splitting of .debug files
Creating FILES_${PN}-dbg is tedious and also pretty pointless. We might as well
assume ".debug" is a special directory name and split into -dbg automatically.

This change does so without changing the rest of the splitting logic too much.
It can be disabled for the cases where we really do want manual control of
the -dbg packages (e.g. qt4) with NOAUTOPACKAGEDEBUG = "1".

(From OE-Core rev: da5ec06814e105451cca11cce76b5c5231110524)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-16 11:56:30 +00:00
Maxin B. John a205c4ce1d bbclass: fix spelling mistakes
Fix some spelling mistakes in bbclass files

(From OE-Core rev: ed484c06f436eea62c5d0b1a2964f219f3e5cb61)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-24 15:50:27 +00:00
Robert Yang 135d09454c prserv.bbclass: remove it since it is null
(From OE-Core rev: 48d78232299735da99137491ae4cbe8faaae3dfb)

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>
2015-10-27 07:24:28 +00:00
Martin Jansa 5624889982 package.bbclass: add summary line to installed-vs-shipped QA check
* there is PN at the beginning, then possibly long list of files and
  at the end we don't see which recipe has this issue, add another
  line which says which PN and how many files

(From OE-Core rev: 32412ac530bcf286980a6f9c7367df4944dd603a)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:52:59 +01:00
Richard Purdie 86d30d756a meta: Add explict getVar param for (non) expansion
Rather than just use d.getVar(X), use the more explict d.getVar(X, False)
since at some point in the future, having the default of expansion would
be nice. This is the first step towards that.

This patch was mostly made using the command:

sed -e 's:\(getVar([^,()]*\)\s*):\1, False):g' -i `grep -ril getVar *`

(From OE-Core rev: ab7c1d239b122c8e549e8112c88fd46c9e2b061b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-23 11:57:25 +01:00
Leonardo Sandoval ace08a2923 package.bbclass: Include missing variables on PACKAGEVARS
PACKAGEVARS appended on this commit:

    LICENSE SECTION
    pkg_preinst
    pkg_prerm
    RREPLACES
    GROUPMEMS_PARAM
    SYSTEMD_AUTO_ENABLE

[Yocto #7754]

(From OE-Core rev: 64a3a4f1b4c6692f0ba9a7192a8e5c2f43beeef2)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-24 07:19:20 +01:00
Richard Purdie bae7794112 package: Fix license exclusion packaging errors
Currently the license exclusion code removes packages from PACKAGES
pre population of the package directories. This means that the FILES
entries for some packages are not seen and invariably results in
packaging errors.

Instead, remove the packages from PACKAGES post population of the packages
so the usual FILES entries work as expected but the file are not placed
into any packages and no packages containing embargoed licenses are generated.

This avoids errors from gcc-runtime with GPLv3 exclusion like:

ERROR: QA Issue: gcc-runtime: Files/directories were installed but not shipped in any package:
  /usr/share
  /usr/src
  /usr/share/gcc-4.9.2
  /usr/share/gcc-4.9.2/python
Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install. [installed-vs-shipped]

(From OE-Core rev: 09c3d648c95fe88197c15d656bda1c9303aa2079)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-30 23:04:18 +01:00
Ed Bartosh 74dc93651f split_and_strip_files: regroup hardlinks to make build deterministic
Reverted 7c0fd561bad0250a00cef63e3d787573112a59cf

Created separate group of hardlinks for the files inside
the same package. This should prevent stripped files to be
populated outside of package directories.

This turns out not to be straightforward and has overlap with the
other hardlink handling code in this area. The code is condensed
into a more concise and documented form.

[Original patch from Ed with tweaks from RP]

[YOCTO #7586]

(From OE-Core rev: 82d00f7254b7d3bb6a167d675d798134884d1b19)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-29 10:58:55 +01:00
Paul Eggleton 9fc558721b classes/package: clarify installed-vs-shipped message
Based on the number of times I've had to explain it over the years it
seems that a lot of new users don't immediately realise what is meant
by "shipped" here (nor should we expect them to) so let's at least
mention packaging and briefly tell the user what they need to do. (I was
going to go into more detail in the message, but there is really more
detail than can be covered succinctly here.)

(From OE-Core rev: 7047d02619547401c313de8c6972a7a0af77e2bc)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-19 13:34:42 +01:00
Andreas Oberritter 349f3ab519 package.bbclass: Add SYSTEMD_SERVICE to list of package specific variables
Changes to SYSTEMD_SERVICE should change the sstate checksum. To make that
happen, it needs to be listed in the list of package specific variables,
therefore add it.

(From OE-Core rev: 0a51f024e8212f011bb8b03d81f18bcd9aa6aa1f)

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-25 12:39:37 +00:00
Chen Qi 0aa5ea1251 packaging: allow globs in CONFFILES
Allow globs in CONFFILES.

This patch changes the way of CONFFILES handling. After this  change,
the CONFFILES can take the same form as FILES. That means, we don't
have to list a bunch of files for CONFFILES. It will just be expanded
like the FILES variable.

We don't assume default value for CONFFILES in OE. But distro vendors could
provide a default value for CONFFILES in their distro configuration file
like below.

    CONFFILES = "${sysconfdir}"

In this way, files under /etc are treated as configuration files by
default. Of course, setting CONFFILES in recipes take precedence over
the CONFFILES. For example, if the recipe author decides that package A
should only treat files under ${sysconfdir}/default/ as config files,
he/she can write like this.

    CONFFILES_A = "${sysconfdir}/default"

[YOCTO #5200]

(From OE-Core rev: 0d446ef0e5bbca7058eec7259e34f2a1637dfab1)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-19 07:51:38 +00:00
Mike Looijmans a9102e5bf9 package.bbclass: Let PR server update PKGV, not PV
PV is the package version as we need it to be during the build. PKGV is the
final version as it ends up in the package, and defaults to PV.

The packager handled builds without PR-server by replacing the AUTOINC string
in PKGV, but when the PR-server is being used, the script replaces the contents
of PKGV with the PV if the PV contains "AUTOINC". Thus the packager overrides
any change to PKGV the recipe might have made.
This breaks classes like gitpkgv that provide a correctly numbered PKGV, the
number as calculated by that class will simply be replaced with a 0-based index
from the PR-server.

This patch makes the packager look at the PKGV version instead of the PV, and
update the PKGV only based on the PKGV contents as set by the recipe.

See also the discussion here:
http://lists.openembedded.org/pipermail/openembedded-core/2015-January/100329.html

From investigating the history of the code and changes in the past year, the
use of "pv" instead of "pkgv" appears to be just an oversight, introduced in:
commit b27b438221e16ac3df6ac66d761b77e3bd43db67 "prs: use the PRServer to replace the BB_URI_LOCALCOUNT functionality"
A later commit 865d001de168915a5796e5c760f96bdd04cebd61 "package/prserv: Merge two similar functions into one"
silently fixed this only for the case without PR-server by using pkgv there.

(From OE-Core rev: 7895c0a67d381ff66668fca5207bd196f36c91db)

Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-01-23 11:36:31 +00:00
Martin Jansa 013de192d7 package.bbclass: Fix support for private libs
* n is a tuple since this commit:
  commit d3aa7668a9f001044d0a0f1ba2de425a36056102
  Author: Richard Purdie <richard.purdie@linuxfoundation.org>
  Date:   Mon Jul 7 18:41:23 2014 +0100
  Subject package.bbclass: Improve shlibs needed data structure

  since then 'n in private_libs' was always false and private libs
  were always processed
* this is bad when we have libfoo in private libs, but also some package
  providing libfoo, that way we ship own libfoo.so, but together with
  runtime dependency on package providing libfoo

(From OE-Core rev: ec1d379683cedca4be1c252475d02c8041227142)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-01-16 23:08:20 +00:00
Paul Eggleton de8730ce2d classes/package: move read_shlib_providers() to a common unit
This allows us to use this function elsewhere in the code.

(From OE-Core rev: 657cff8a0f0e5db171b2ed9388a790ee0b135842)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-21 12:37:56 +00:00
Peter Seebach 244cb9b5c3 package.bbclass: do variable fixups even when FILES was set
A number of settings (DESCRIPTION, SUMMARY, postinst, postrm,
and appends to RDEPENDS) were made only if FILES_foo was not
set for a given package. If you had a modified glibc packaging
setup that was defining FILES_glibc-gconv-somelocale, this would
prevent the automatic append of glibc-gconv as a dependency,
because extra_depends was ignored.

I think the assumption may have been that if FILES_foo was set,
DESCRIPTION_foo and SUMMARY_foo would also be set, but it seems
to me that the right answer is probably to set them if they aren't
already set, and leave them alone if they are.

(From OE-Core rev: 7e59b0c7e03fc08a6eaf9c8ccb6bfa72b4604cc5)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-19 18:08:00 +00:00
Khem Raj ec4781194c package.bbclass: Create empty key/value if not there for shlib_provider
When we use ASSUME_SHLIBS,e.g.

ASSUME_SHLIBS = "libEGL.so.1:libegl-implementation"

then we end up with errors like below when using shlibs2 (dizzy+)

File: 'package_do_shlibs', lineno: 216, function: package_do_shlibs
     0212:            dep_pkg = dep_pkg.rsplit("_", 1)
     0213:            if len(dep_pkg) == 2:
     0214:                lib_ver = dep_pkg[1]
     0215:            dep_pkg = dep_pkg[0]
 *** 0216:            shlib_provider[l][libdir] = (dep_pkg, lib_ver)
     0217:
     0218:    libsearchpath = [d.getVar('libdir', True),
d.getVar('base_libdir', True)]
     0219:
     0220:    for pkg in packages.split():
Exception: KeyError: 'libEGL.so.1'

This is because the entry which is being populated does not exist
so lets create it if its not already there.

Change-Id: I9e292c5439e5d1e01ea48341334507aacc3784ae
(From OE-Core rev: a64f81fcef42172f788cec7a63bb4672eac99f94)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-03 12:23:58 +00:00
Richard Purdie 593f14b2e3 package/prserv: Merge two similar functions into one
Having these two separate functions handling PR values seems pointless,
and worse, there are impossible code branches mixed within them.

Merge them into one function and tweak comments so at least you
don't have to read both functions to figure out what is going on.

This does restructure the conditionals to try and aid readability.

(From OE-Core rev: 865d001de168915a5796e5c760f96bdd04cebd61)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-11-09 10:21:19 +00:00
Khem Raj b2f1250f6d package_do_shlibs: Look for provider in the path thats in shlib_provider dictionary
shlib2 code puts the information about path where a provider
will be found. e.g.

{'/usr/lib/llvm3.3': ('libllvm3.3-llvm-3.3', '3.3')}

This is obtained from new shlib2 pkgdata from

llvm3.3/3.3-r0/pkgdata/shlibs2/libllvm3.3-llvm-3.3.list

However when we search for NEEDED libraries we ignore the
key above which is the path where the provider library is installed
and instead just seach in libdir and base_libdir and hence
libraries which are not in above standard search paths gets
ignored even if they appear in DT_NEEDED sections

and a note is emitted

NOTE: Couldn't find shared library provider for libLLVM-3.3.so, used by
files: ....

IMO this note should actually become an error since if we do
not have all DT_NEEDED libraries in image the system is dysfunctional.

This patch extracts this libpath from key and add it to seach paths
when looing for a provider of a shared library

[YOCTO #6798]

Change-Id: Ie5f08632e37ba8d3439c8aaae33bc68b8996792f
(From OE-Core rev: bf8472274ac1e9a35f8cbc82357da6c95b396759)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-10-10 22:40:45 +01:00
Otavio Salvador 533a852edd package.bbclass: Reverse runtime symlinks should be tied to package generation
In case a package is not generated (is empty and does not has allow
empty flag set) the package data regarding reverse runtime dependency
shouldn't be done.

This were causing a false-positive in the meta-fsl-arm layer, when
building mesa, as:

,----[ Error during build of MX53 in meta-fsl-arm ]
| ERROR: The recipe mesa is trying to install files into a shared area
|  when those files already exist. Those files and their manifest
|  location are:
|    /.../build/build/tmp/sysroots/imx53qsb/pkgdata/runtime-reverse/libopenvg-dev
|    Matched in manifest-imx53qsb-amd-gpu-x11-bin-mx51.packagedata
| Please verify which recipe should provide the above files.
`----

Fixes [YOCTO: #6795]

(From OE-Core rev: 9ef8728514b02dd2e18e87645298d9ec2e8a785a)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-10-06 15:15:52 +01:00
Peter Kjellerstedt 9f36a3c445 package: Correct two typos in a comment
This quite coincidentally invalidates the sstate for do_package which
is needed due to the correction of oe.utils.multiprocess_exec().

(From OE-Core rev: 9972f0686794a01582fd1a15889dcbd89bc5cf72)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-29 23:44:37 +01:00
Richard Purdie 1a76648ec9 package: Disable runtime mapping of RPROVIDES/RCONFLICTS/RREPLACES
It doesn't really make sense to run the remapping code on these
variables. If specific renaming is needed, it should be applied
manually. This means that the debian RPROVIDES of the original package
name can be preserved. There was also a bug report about this on the
OE-Core mailing list recently where someone else ran into this problem
too.

(From OE-Core rev: a0cd18ff5405b63b8296b8ef1fc2a488b906f576)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-25 08:57:45 +01:00
Richard Purdie ff6ab056c7 package: Don't remap names in packagegroup recipes
For package groups, use the original package names and don't use the
remapped (e.g. debian) naming.

(From OE-Core rev: afde71e8784144f05cebb0bdeeff6b3184819362)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-25 08:57:44 +01:00
Richard Purdie 9412254f23 package.bbclass: Fixup for using common function
We may as well use the common function for this rather than
duplicating the code.

(From OE-Core rev: 20979854c52607212c16e0b01cf610c80d8b524e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-23 09:31:41 +01:00
Richard Purdie b52132122c package: Fix darwin shlibs code
We need to scan binaries as well as libraries for dependencies.

Also ensure if its not an object file (as found by otool), we handle
this case.

(From OE-Core rev: 3a26862b7a7e0ff247bd1441d670443e83fca391)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-04 16:25:46 +01:00
Richard Purdie 53eaed5c15 package: Convert dylib handling from .la to otool
Currently, the darwin shlibs detection is done by parsing the .la file
dependency fields. This is very old code and is incomplete in some
cases so convert to using otool -l and otool -L to correctly load
the rpath and dependency information.

(From OE-Core rev: e27573b6c3562662e4b2f5d8543eb7d150c3bc92)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-03 12:40:41 +01:00
Richard Purdie c70203998b package: Fix pkgdest for darwin shlibs code
When the code was rewritten we forgot to strip the pkg that is present
in the pkgdest path. This was fixed in the linux version of the code
but not the darwin one, this matches the fix.

Without this, the provider paths are broken.

(From OE-Core rev: bcada055f89c8722024faf20088943ea006cfe36)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-03 12:40:41 +01:00
Ross Burton 360171c843 package.bbclass: add a stub implementation of package_name_hook
do_package() calls package_name_hook so that e.g. debian-style renaming through
debian.bbclass can happen.  If there is no class providing a package_name_hook
then this causes "WARNING: Function package_name_hook doesn't exist" every time
do_package() is executed.

Silence this warning by providing an empty package_name_hook in package.bbclass.

(From OE-Core rev: f6eb8e4e44b66217e4ada9f830a058c5ba120932)

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>
2014-07-10 17:38:33 +01:00
Richard Purdie e35d6269ba package.bbclass: Generate runtime-rprovides data
Currently, given a list of rdepends its near impossible to figure out
which ones are potentially invalid and which might be an RPROVIDES of a
package.

This problem is simple to solve, we can write lookup data into the
pkgdata. This patch does that, accounting for the fact that multiple
packages can RPROVIDE the same thing (particularly with locales). Its
done with symlinks so the performance overhead is minimal.

(From OE-Core rev: 30b4bff944c4625696e9be97ce4912a2710d13e9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-10 17:38:32 +01:00
Richard Purdie 3ead62a578 package.bbclass: Rewrite shlib_provider handling to include RPATH
Change the do_package shlibs code to account for RPATHS. This means that
for library dependency purposes, only libraries in system paths or in
any declared RPATH will be seen. This is important to resolve problems
people have been having where similarly named libraries in "private"
paths were conflicting, e.g. with gstreamer.

For now this code assumes the default search path is libdir and
base_libdir and places ASSUME_SHLIBS in libdir so they are searched by
default.

(From OE-Core rev: 48b9ecd5335f63fb2bcc47c4b23d067122734fe9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-10 17:38:31 +01:00