diff options
Diffstat (limited to 'meta/classes/package.bbclass')
-rw-r--r-- | meta/classes/package.bbclass | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass index c8aafc9752..a14561d5ac 100644 --- a/meta/classes/package.bbclass +++ b/meta/classes/package.bbclass | |||
@@ -375,17 +375,13 @@ def get_package_mapping (pkg, d): | |||
375 | def runtime_mapping_rename (varname, d): | 375 | def runtime_mapping_rename (varname, d): |
376 | #bb.note("%s before: %s" % (varname, d.getVar(varname, True))) | 376 | #bb.note("%s before: %s" % (varname, d.getVar(varname, True))) |
377 | 377 | ||
378 | new_depends = [] | 378 | new_depends = {} |
379 | deps = bb.utils.explode_dep_versions(d.getVar(varname, True) or "") | 379 | deps = bb.utils.explode_dep_versions2(d.getVar(varname, True) or "") |
380 | for depend in deps: | 380 | for depend in deps: |
381 | # Have to be careful with any version component of the depend | ||
382 | new_depend = get_package_mapping(depend, d) | 381 | new_depend = get_package_mapping(depend, d) |
383 | if deps[depend]: | 382 | new_depends[new_depend] = deps[depend] |
384 | new_depends.append("%s (%s)" % (new_depend, deps[depend])) | ||
385 | else: | ||
386 | new_depends.append(new_depend) | ||
387 | 383 | ||
388 | d.setVar(varname, " ".join(new_depends) or None) | 384 | d.setVar(varname, bb.utils.join_deps(new_depends, commasep=False)) |
389 | 385 | ||
390 | #bb.note("%s after: %s" % (varname, d.getVar(varname, True))) | 386 | #bb.note("%s after: %s" % (varname, d.getVar(varname, True))) |
391 | 387 | ||
@@ -1078,7 +1074,7 @@ python populate_packages () { | |||
1078 | dangling_links[pkg].append(os.path.normpath(target)) | 1074 | dangling_links[pkg].append(os.path.normpath(target)) |
1079 | 1075 | ||
1080 | for pkg in package_list: | 1076 | for pkg in package_list: |
1081 | rdepends = bb.utils.explode_dep_versions(d.getVar('RDEPENDS_' + pkg, True) or d.getVar('RDEPENDS', True) or "") | 1077 | rdepends = bb.utils.explode_dep_versions2(d.getVar('RDEPENDS_' + pkg, True) or d.getVar('RDEPENDS', True) or "") |
1082 | 1078 | ||
1083 | for l in dangling_links[pkg]: | 1079 | for l in dangling_links[pkg]: |
1084 | found = False | 1080 | found = False |
@@ -1091,7 +1087,7 @@ python populate_packages () { | |||
1091 | if p == pkg: | 1087 | if p == pkg: |
1092 | break | 1088 | break |
1093 | if p not in rdepends: | 1089 | if p not in rdepends: |
1094 | rdepends[p] = "" | 1090 | rdepends[p] = [] |
1095 | break | 1091 | break |
1096 | if found == False: | 1092 | if found == False: |
1097 | bb.note("%s contains dangling symlink to %s" % (pkg, l)) | 1093 | bb.note("%s contains dangling symlink to %s" % (pkg, l)) |
@@ -1637,14 +1633,19 @@ def read_libdep_files(d): | |||
1637 | pkglibdeps = {} | 1633 | pkglibdeps = {} |
1638 | packages = d.getVar('PACKAGES', True).split() | 1634 | packages = d.getVar('PACKAGES', True).split() |
1639 | for pkg in packages: | 1635 | for pkg in packages: |
1640 | pkglibdeps[pkg] = [] | 1636 | pkglibdeps[pkg] = {} |
1641 | for extension in ".shlibdeps", ".pcdeps", ".clilibdeps": | 1637 | for extension in ".shlibdeps", ".pcdeps", ".clilibdeps": |
1642 | depsfile = d.expand("${PKGDEST}/" + pkg + extension) | 1638 | depsfile = d.expand("${PKGDEST}/" + pkg + extension) |
1643 | if os.access(depsfile, os.R_OK): | 1639 | if os.access(depsfile, os.R_OK): |
1644 | fd = file(depsfile) | 1640 | fd = file(depsfile) |
1645 | lines = fd.readlines() | 1641 | lines = fd.readlines() |
1646 | fd.close() | 1642 | fd.close() |
1647 | pkglibdeps[pkg].extend([l.rstrip() for l in lines]) | 1643 | for l in lines: |
1644 | l.rstrip() | ||
1645 | deps = bb.utils.explode_dep_versions2(l) | ||
1646 | for dep in deps: | ||
1647 | if not dep in pkglibdeps[pkg]: | ||
1648 | pkglibdeps[pkg][dep] = deps[dep] | ||
1648 | return pkglibdeps | 1649 | return pkglibdeps |
1649 | 1650 | ||
1650 | python read_shlibdeps () { | 1651 | python read_shlibdeps () { |
@@ -1652,9 +1653,14 @@ python read_shlibdeps () { | |||
1652 | 1653 | ||
1653 | packages = d.getVar('PACKAGES', True).split() | 1654 | packages = d.getVar('PACKAGES', True).split() |
1654 | for pkg in packages: | 1655 | for pkg in packages: |
1655 | rdepends = bb.utils.explode_dep_versions(d.getVar('RDEPENDS_' + pkg, False) or d.getVar('RDEPENDS', False) or "") | 1656 | rdepends = bb.utils.explode_dep_versions2(d.getVar('RDEPENDS_' + pkg, False) or d.getVar('RDEPENDS', False) or "") |
1656 | for dep in pkglibdeps[pkg]: | 1657 | for dep in pkglibdeps[pkg]: |
1657 | rdepends[dep] = "" | 1658 | # Add the dep if it's not already there, or if no comparison is set |
1659 | if dep not in rdepends: | ||
1660 | rdepends[dep] = [] | ||
1661 | for v in pkglibdeps[pkg][dep]: | ||
1662 | if v not in rdepends[dep]: | ||
1663 | rdepends[dep].append(v) | ||
1658 | d.setVar('RDEPENDS_' + pkg, bb.utils.join_deps(rdepends, commasep=False)) | 1664 | d.setVar('RDEPENDS_' + pkg, bb.utils.join_deps(rdepends, commasep=False)) |
1659 | } | 1665 | } |
1660 | 1666 | ||
@@ -1679,7 +1685,7 @@ python package_depchains() { | |||
1679 | def pkg_adddeprrecs(pkg, base, suffix, getname, depends, d): | 1685 | def pkg_adddeprrecs(pkg, base, suffix, getname, depends, d): |
1680 | 1686 | ||
1681 | #bb.note('depends for %s is %s' % (base, depends)) | 1687 | #bb.note('depends for %s is %s' % (base, depends)) |
1682 | rreclist = bb.utils.explode_dep_versions(d.getVar('RRECOMMENDS_' + pkg, True) or d.getVar('RRECOMMENDS', True) or "") | 1688 | rreclist = bb.utils.explode_dep_versions2(d.getVar('RRECOMMENDS_' + pkg, True) or d.getVar('RRECOMMENDS', True) or "") |
1683 | 1689 | ||
1684 | for depend in depends: | 1690 | for depend in depends: |
1685 | if depend.find('-native') != -1 or depend.find('-cross') != -1 or depend.startswith('virtual/'): | 1691 | if depend.find('-native') != -1 or depend.find('-cross') != -1 or depend.startswith('virtual/'): |
@@ -1692,7 +1698,7 @@ python package_depchains() { | |||
1692 | pkgname = getname(depend, suffix) | 1698 | pkgname = getname(depend, suffix) |
1693 | #bb.note("Adding %s for %s" % (pkgname, depend)) | 1699 | #bb.note("Adding %s for %s" % (pkgname, depend)) |
1694 | if pkgname not in rreclist and pkgname != pkg: | 1700 | if pkgname not in rreclist and pkgname != pkg: |
1695 | rreclist[pkgname] = "" | 1701 | rreclist[pkgname] = [] |
1696 | 1702 | ||
1697 | #bb.note('setting: RRECOMMENDS_%s=%s' % (pkg, ' '.join(rreclist))) | 1703 | #bb.note('setting: RRECOMMENDS_%s=%s' % (pkg, ' '.join(rreclist))) |
1698 | d.setVar('RRECOMMENDS_%s' % pkg, bb.utils.join_deps(rreclist, commasep=False)) | 1704 | d.setVar('RRECOMMENDS_%s' % pkg, bb.utils.join_deps(rreclist, commasep=False)) |
@@ -1700,7 +1706,7 @@ python package_depchains() { | |||
1700 | def pkg_addrrecs(pkg, base, suffix, getname, rdepends, d): | 1706 | def pkg_addrrecs(pkg, base, suffix, getname, rdepends, d): |
1701 | 1707 | ||
1702 | #bb.note('rdepends for %s is %s' % (base, rdepends)) | 1708 | #bb.note('rdepends for %s is %s' % (base, rdepends)) |
1703 | rreclist = bb.utils.explode_dep_versions(d.getVar('RRECOMMENDS_' + pkg, True) or d.getVar('RRECOMMENDS', True) or "") | 1709 | rreclist = bb.utils.explode_dep_versions2(d.getVar('RRECOMMENDS_' + pkg, True) or d.getVar('RRECOMMENDS', True) or "") |
1704 | 1710 | ||
1705 | for depend in rdepends: | 1711 | for depend in rdepends: |
1706 | if depend.find('virtual-locale-') != -1: | 1712 | if depend.find('virtual-locale-') != -1: |
@@ -1713,13 +1719,12 @@ python package_depchains() { | |||
1713 | pkgname = getname(depend, suffix) | 1719 | pkgname = getname(depend, suffix) |
1714 | #bb.note("Adding %s for %s" % (pkgname, depend)) | 1720 | #bb.note("Adding %s for %s" % (pkgname, depend)) |
1715 | if pkgname not in rreclist and pkgname != pkg: | 1721 | if pkgname not in rreclist and pkgname != pkg: |
1716 | rreclist[pkgname] = "" | 1722 | rreclist[pkgname] = [] |
1717 | 1723 | ||
1718 | #bb.note('setting: RRECOMMENDS_%s=%s' % (pkg, ' '.join(rreclist))) | 1724 | #bb.note('setting: RRECOMMENDS_%s=%s' % (pkg, ' '.join(rreclist))) |
1719 | d.setVar('RRECOMMENDS_%s' % pkg, bb.utils.join_deps(rreclist, commasep=False)) | 1725 | d.setVar('RRECOMMENDS_%s' % pkg, bb.utils.join_deps(rreclist, commasep=False)) |
1720 | 1726 | ||
1721 | def add_dep(list, dep): | 1727 | def add_dep(list, dep): |
1722 | dep = dep.split(' (')[0].strip() | ||
1723 | if dep not in list: | 1728 | if dep not in list: |
1724 | list.append(dep) | 1729 | list.append(dep) |
1725 | 1730 | ||
@@ -1758,10 +1763,7 @@ python package_depchains() { | |||
1758 | 1763 | ||
1759 | if "-dbg" in pkgs: | 1764 | if "-dbg" in pkgs: |
1760 | pkglibdeps = read_libdep_files(d) | 1765 | pkglibdeps = read_libdep_files(d) |
1761 | pkglibdeplist = [] | 1766 | pkglibdeplist = pkglibdeps.keys() |
1762 | for pkg in pkglibdeps: | ||
1763 | for dep in pkglibdeps[pkg]: | ||
1764 | add_dep(pkglibdeplist, dep) | ||
1765 | # FIXME this should not look at PN once all task recipes inherit from task.bbclass | 1767 | # FIXME this should not look at PN once all task recipes inherit from task.bbclass |
1766 | dbgdefaultdeps = ((d.getVar('DEPCHAIN_DBGDEFAULTDEPS', True) == '1') or (d.getVar('PN', True) or '').startswith('packagegroup-')) | 1768 | dbgdefaultdeps = ((d.getVar('DEPCHAIN_DBGDEFAULTDEPS', True) == '1') or (d.getVar('PN', True) or '').startswith('packagegroup-')) |
1767 | 1769 | ||