diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2012-07-26 15:35:00 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-07-28 09:20:52 +0100 |
commit | a5227e205b4b22fd27989a3ca6bd722d35ac1435 (patch) | |
tree | 01cbaba67206adb74fb7a3d80117a92c30f25300 /meta/classes | |
parent | 58a7be460c9affe79b0c3d33abc79017e463b9a3 (diff) | |
download | poky-a5227e205b4b22fd27989a3ca6bd722d35ac1435.tar.gz |
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>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/package.bbclass | 32 | ||||
-rw-r--r-- | meta/classes/task.bbclass | 3 |
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 () { | |||
1580 | bb.utils.unlockfile(lf) | 1580 | bb.utils.unlockfile(lf) |
1581 | } | 1581 | } |
1582 | 1582 | ||
1583 | python read_shlibdeps () { | 1583 | def read_libdep_files(d): |
1584 | pkglibdeps = {} | ||
1584 | packages = d.getVar('PACKAGES', True).split() | 1585 | packages = d.getVar('PACKAGES', True).split() |
1585 | for pkg in packages: | 1586 | for pkg in packages: |
1586 | rdepends = bb.utils.explode_dep_versions(d.getVar('RDEPENDS_' + pkg, False) or d.getVar('RDEPENDS', False) or "") | 1587 | pkglibdeps[pkg] = [] |
1587 | |||
1588 | for extension in ".shlibdeps", ".pcdeps", ".clilibdeps": | 1588 | for extension in ".shlibdeps", ".pcdeps", ".clilibdeps": |
1589 | depsfile = d.expand("${PKGDEST}/" + pkg + extension) | 1589 | depsfile = d.expand("${PKGDEST}/" + pkg + extension) |
1590 | if os.access(depsfile, os.R_OK): | 1590 | if os.access(depsfile, os.R_OK): |
1591 | fd = file(depsfile) | 1591 | fd = file(depsfile) |
1592 | lines = fd.readlines() | 1592 | lines = fd.readlines() |
1593 | fd.close() | 1593 | fd.close() |
1594 | for l in lines: | 1594 | pkglibdeps[pkg].extend([l.rstrip() for l in lines]) |
1595 | rdepends[l.rstrip()] = "" | 1595 | return pkglibdeps |
1596 | |||
1597 | python read_shlibdeps () { | ||
1598 | pkglibdeps = read_libdep_files(d) | ||
1599 | |||
1600 | packages = d.getVar('PACKAGES', True).split() | ||
1601 | for pkg in packages: | ||
1602 | rdepends = bb.utils.explode_dep_versions(d.getVar('RDEPENDS_' + pkg, False) or d.getVar('RDEPENDS', False) or "") | ||
1603 | for dep in pkglibdeps[pkg]: | ||
1604 | rdepends[dep] = "" | ||
1596 | d.setVar('RDEPENDS_' + pkg, bb.utils.join_deps(rdepends, commasep=False)) | 1605 | d.setVar('RDEPENDS_' + pkg, bb.utils.join_deps(rdepends, commasep=False)) |
1597 | } | 1606 | } |
1598 | 1607 | ||
@@ -1694,6 +1703,15 @@ python package_depchains() { | |||
1694 | pkgs[prefix] = {} | 1703 | pkgs[prefix] = {} |
1695 | pkgs[prefix][pkg] = (pkg[:-len(prefix)], pre_getname) | 1704 | pkgs[prefix][pkg] = (pkg[:-len(prefix)], pre_getname) |
1696 | 1705 | ||
1706 | if "-dbg" in pkgs: | ||
1707 | pkglibdeps = read_libdep_files(d) | ||
1708 | pkglibdeplist = [] | ||
1709 | for pkg in pkglibdeps: | ||
1710 | for dep in pkglibdeps[pkg]: | ||
1711 | add_dep(pkglibdeplist, dep) | ||
1712 | # FIXME this should not look at PN once all task recipes inherit from task.bbclass | ||
1713 | dbgdefaultdeps = ((d.getVar('DEPCHAIN_DBGDEFAULTDEPS', True) == '1') or (d.getVar('PN', True) or '').startswith('task-')) | ||
1714 | |||
1697 | for suffix in pkgs: | 1715 | for suffix in pkgs: |
1698 | for pkg in pkgs[suffix]: | 1716 | for pkg in pkgs[suffix]: |
1699 | if d.getVarFlag('RRECOMMENDS_' + pkg, 'nodeprrecs'): | 1717 | if d.getVarFlag('RRECOMMENDS_' + pkg, 'nodeprrecs'): |
@@ -1701,6 +1719,10 @@ python package_depchains() { | |||
1701 | (base, func) = pkgs[suffix][pkg] | 1719 | (base, func) = pkgs[suffix][pkg] |
1702 | if suffix == "-dev": | 1720 | if suffix == "-dev": |
1703 | pkg_adddeprrecs(pkg, base, suffix, func, depends, d) | 1721 | pkg_adddeprrecs(pkg, base, suffix, func, depends, d) |
1722 | elif suffix == "-dbg": | ||
1723 | if not dbgdefaultdeps: | ||
1724 | pkg_addrrecs(pkg, base, suffix, func, pkglibdeplist, d) | ||
1725 | continue | ||
1704 | if len(pkgs[suffix]) == 1: | 1726 | if len(pkgs[suffix]) == 1: |
1705 | pkg_addrrecs(pkg, base, suffix, func, rdepends, d) | 1727 | pkg_addrrecs(pkg, base, suffix, func, rdepends, d) |
1706 | else: | 1728 | 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 () { | |||
25 | d.setVar('PACKAGES', ' '.join(packages+genpackages)) | 25 | d.setVar('PACKAGES', ' '.join(packages+genpackages)) |
26 | } | 26 | } |
27 | 27 | ||
28 | # We don't want to look at shared library dependencies for the | ||
29 | # dbg packages | ||
30 | DEPCHAIN_DBGDEFAULTDEPS = "1" | ||