package.bbclass: Account for DEPENDS in -dev packages
authorRichard Purdie <richard@openedhand.com>
Wed, 9 Jan 2008 13:50:38 +0000 (13:50 +0000)
committerRichard Purdie <richard@openedhand.com>
Wed, 9 Jan 2008 13:50:38 +0000 (13:50 +0000)
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@3439 311d38ba-8fff-0310-9ca6-ca027cbcb966

meta/classes/package.bbclass

index 4d9553d..7a8ebf4 100644 (file)
@@ -484,6 +484,7 @@ python emit_pkgdata() {
        for pkg in packages.split():
                subdata_file = bb.data.expand("${PKGDATA_DIR}/runtime/%s" % pkg, d)
                sf = open(subdata_file, 'w')
+               write_if_exists(sf, pkg, 'PN')
                write_if_exists(sf, pkg, 'DESCRIPTION')
                write_if_exists(sf, pkg, 'RDEPENDS')
                write_if_exists(sf, pkg, 'RPROVIDES')
@@ -803,9 +804,26 @@ python package_depchains() {
        postfixes = (bb.data.getVar('DEPCHAIN_POST', d, 1) or '').split()
        prefixes  = (bb.data.getVar('DEPCHAIN_PRE', d, 1) or '').split()
 
+       def pkg_adddeprrecs(pkg, base, suffix, getname, depends, d):
+
+               #bb.note('depends for %s is %s' % (base, depends))
+               rreclist = explode_deps(bb.data.getVar('RRECOMMENDS_' + pkg, d, 1) or bb.data.getVar('RRECOMMENDS', d, 1) or "")
+
+               for depend in depends:
+                       if depend.find('-native') != -1 or depend.find('-cross') != -1 or depend.startswith('virtual/'):
+                               #bb.note("Skipping %s" % depend)
+                               continue
+                       pkgname = getname(depend, suffix)
+                       #bb.note("Adding %s for %s" % (pkgname, depend))
+                       if not pkgname in rreclist:
+                               rreclist.append(pkgname)
+
+               #bb.note('setting: RRECOMMENDS_%s=%s' % (pkg, ' '.join(rreclist)))
+               bb.data.setVar('RRECOMMENDS_%s' % pkg, ' '.join(rreclist), d)
+
        def pkg_addrrecs(pkg, base, suffix, getname, rdepends, d):
-        #bb.note('rdepends for %s is %s' % (base, rdepends))
 
+               #bb.note('rdepends for %s is %s' % (base, rdepends))
                rreclist = explode_deps(bb.data.getVar('RRECOMMENDS_' + pkg, d, 1) or bb.data.getVar('RRECOMMENDS', d, 1) or "")
 
                for depend in rdepends:
@@ -821,6 +839,10 @@ python package_depchains() {
                if dep not in list:
                        list.append(dep)
 
+       depends = []
+       for dep in explode_deps(bb.data.getVar('DEPENDS', d, 1) or ""):
+               add_dep(depends, dep)
+
        rdepends = []
        for dep in explode_deps(bb.data.getVar('RDEPENDS', d, 1) or ""):
                add_dep(rdepends, dep)
@@ -853,6 +875,8 @@ python package_depchains() {
        for suffix in pkgs:
                for pkg in pkgs[suffix]:
                        (base, func) = pkgs[suffix][pkg]
+                       if suffix == "-dev":
+                               pkg_adddeprrecs(pkg, base, suffix, func, depends, d)
                        if len(pkgs[suffix]) == 1:
                                pkg_addrrecs(pkg, base, suffix, func, rdepends, d)
                        else: