classes/package: reduce dbg package dependencies

Make dbg package dependencies added via DEPCHAIN_POST less aggressive -
only add dependencies on dbg packages for shared library dependencies.
This avoids dragging in extraneous packages (such as eglibc-dbg forcing
bash-dbg to be installed) whilst preserving the ability to easily debug
into shared libraries in use by an application by just requesting the
installation of the single dbg package for that application.

For task recipes however we preserve the previous behaviour, since when
you install task-xxx-dbg you expect the dbg packages for every package
in the task to be installed. Unfortunately not all of our tasks inherit
from task.bbclass so we just use a name match - this should be tidied up
later.

Fixes [YOCTO #2599].

(From OE-Core rev: 352522d474cb75992d7865545b6fbe4e157a5f99)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Paul Eggleton 2012-07-26 15:35:00 +01:00 committed by Richard Purdie
parent 58a7be460c
commit a5227e205b
2 changed files with 30 additions and 5 deletions

View File

@ -1580,19 +1580,28 @@ python package_do_pkgconfig () {
bb.utils.unlockfile(lf)
}
python read_shlibdeps () {
def read_libdep_files(d):
pkglibdeps = {}
packages = d.getVar('PACKAGES', True).split()
for pkg in packages:
rdepends = bb.utils.explode_dep_versions(d.getVar('RDEPENDS_' + pkg, False) or d.getVar('RDEPENDS', False) or "")
pkglibdeps[pkg] = []
for extension in ".shlibdeps", ".pcdeps", ".clilibdeps":
depsfile = d.expand("${PKGDEST}/" + pkg + extension)
if os.access(depsfile, os.R_OK):
fd = file(depsfile)
lines = fd.readlines()
fd.close()
for l in lines:
rdepends[l.rstrip()] = ""
pkglibdeps[pkg].extend([l.rstrip() for l in lines])
return pkglibdeps
python read_shlibdeps () {
pkglibdeps = read_libdep_files(d)
packages = d.getVar('PACKAGES', True).split()
for pkg in packages:
rdepends = bb.utils.explode_dep_versions(d.getVar('RDEPENDS_' + pkg, False) or d.getVar('RDEPENDS', False) or "")
for dep in pkglibdeps[pkg]:
rdepends[dep] = ""
d.setVar('RDEPENDS_' + pkg, bb.utils.join_deps(rdepends, commasep=False))
}
@ -1694,6 +1703,15 @@ python package_depchains() {
pkgs[prefix] = {}
pkgs[prefix][pkg] = (pkg[:-len(prefix)], pre_getname)
if "-dbg" in pkgs:
pkglibdeps = read_libdep_files(d)
pkglibdeplist = []
for pkg in pkglibdeps:
for dep in pkglibdeps[pkg]:
add_dep(pkglibdeplist, dep)
# FIXME this should not look at PN once all task recipes inherit from task.bbclass
dbgdefaultdeps = ((d.getVar('DEPCHAIN_DBGDEFAULTDEPS', True) == '1') or (d.getVar('PN', True) or '').startswith('task-'))
for suffix in pkgs:
for pkg in pkgs[suffix]:
if d.getVarFlag('RRECOMMENDS_' + pkg, 'nodeprrecs'):
@ -1701,6 +1719,10 @@ python package_depchains() {
(base, func) = pkgs[suffix][pkg]
if suffix == "-dev":
pkg_adddeprrecs(pkg, base, suffix, func, depends, d)
elif suffix == "-dbg":
if not dbgdefaultdeps:
pkg_addrrecs(pkg, base, suffix, func, pkglibdeplist, d)
continue
if len(pkgs[suffix]) == 1:
pkg_addrrecs(pkg, base, suffix, func, rdepends, d)
else:

View File

@ -25,3 +25,6 @@ python () {
d.setVar('PACKAGES', ' '.join(packages+genpackages))
}
# We don't want to look at shared library dependencies for the
# dbg packages
DEPCHAIN_DBGDEFAULTDEPS = "1"