summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2012-07-26 15:35:00 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-07-27 14:07:23 +0100
commit352522d474cb75992d7865545b6fbe4e157a5f99 (patch)
tree09fb7d0dffbc6ae5dcb54ea87584711610e55792
parentf9ae930552bc5f1d59f207d4cd0e2b1b4f811dbc (diff)
downloadopenembedded-core-352522d474cb75992d7865545b6fbe4e157a5f99.tar.gz
openembedded-core-352522d474cb75992d7865545b6fbe4e157a5f99.tar.bz2
openembedded-core-352522d474cb75992d7865545b6fbe4e157a5f99.zip
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]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
-rw-r--r--meta/classes/package.bbclass32
-rw-r--r--meta/classes/task.bbclass3
2 files changed, 30 insertions, 5 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 962abcd8d9..efb03f89bf 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -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:
diff --git a/meta/classes/task.bbclass b/meta/classes/task.bbclass
index 22c2fd3744..6ec154a033 100644
--- a/meta/classes/task.bbclass
+++ b/meta/classes/task.bbclass
@@ -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"