summaryrefslogtreecommitdiffstats
path: root/meta/classes/package.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2007-03-29 09:49:07 +0000
committerRichard Purdie <richard@openedhand.com>2007-03-29 09:49:07 +0000
commit887b8b1289102e4da1ee66957afc19e375789899 (patch)
tree605ab68102542fbd0c5da2ed788f505003362903 /meta/classes/package.bbclass
parent66ec83e1cd046f90e41f3d03d16f226b59eb1278 (diff)
downloadpoky-887b8b1289102e4da1ee66957afc19e375789899.tar.gz
package.bbclass: Improve recommends dependency code to catch all dependencies for -dbg and -dev packages, not just some
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1409 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/classes/package.bbclass')
-rw-r--r--meta/classes/package.bbclass49
1 files changed, 28 insertions, 21 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 415eb326c0..21fe94e94e 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -805,44 +805,51 @@ python package_depchains() {
805 postfixes = (bb.data.getVar('DEPCHAIN_POST', d, 1) or '').split() 805 postfixes = (bb.data.getVar('DEPCHAIN_POST', d, 1) or '').split()
806 prefixes = (bb.data.getVar('DEPCHAIN_PRE', d, 1) or '').split() 806 prefixes = (bb.data.getVar('DEPCHAIN_PRE', d, 1) or '').split()
807 807
808 def pkg_addrrecs(pkg, base, func, d): 808 def pkg_addrrecs(pkg, base, getname, rdepends, d):
809 rdepends = explode_deps(bb.data.getVar('RDEPENDS_' + base, d, 1) or bb.data.getVar('RDEPENDS', d, 1) or "") 809 def packaged(pkg, d):
810 # bb.note('rdepends for %s is %s' % (base, rdepends)) 810 return os.access(bb.data.expand('${STAGING_DIR}/pkgdata/runtime/%s.packaged' % pkg, d), os.R_OK)
811
811 rreclist = explode_deps(bb.data.getVar('RRECOMMENDS_' + pkg, d, 1) or bb.data.getVar('RRECOMMENDS', d, 1) or "") 812 rreclist = explode_deps(bb.data.getVar('RRECOMMENDS_' + pkg, d, 1) or bb.data.getVar('RRECOMMENDS', d, 1) or "")
812 813
813 for depend in rdepends: 814 for depend in rdepends:
814 split_depend = depend.split(' (') 815 pkgname = getname(depend)
815 name = split_depend[0].strip() 816 if not pkgname in rreclist and packaged(pkgname, d):
816 func(rreclist, name) 817 rreclist.append(pkgname)
817 818
819 #bb.note('setting: RRECOMMENDS_%s=%s' % (pkg, ' '.join(rreclist)))
818 bb.data.setVar('RRECOMMENDS_%s' % pkg, ' '.join(rreclist), d) 820 bb.data.setVar('RRECOMMENDS_%s' % pkg, ' '.join(rreclist), d)
819 821
820 def packaged(pkg, d): 822 def add_dep(list, dep):
821 return os.access(bb.data.expand('${STAGING_DIR}/pkgdata/runtime/%s.packaged' % pkg, d), os.R_OK) 823 dep = dep.split(' (')[0].strip()
824 if dep not in list:
825 list.append(dep)
826
827 rdepends = []
828 for dep in explode_deps(bb.data.getVar('RDEPENDS', d, 1) or ""):
829 add_dep(rdepends, dep)
830
831 for pkg in packages.split():
832 for dep in explode_deps(bb.data.getVar('RDEPENDS_' + pkg, d, 1) or ""):
833 add_dep(rdepends, dep)
834
835 #bb.note('rdepends is %s' % rdepends)
822 836
823 for pkg in packages.split(): 837 for pkg in packages.split():
824 for postfix in postfixes: 838 for postfix in postfixes:
825 def func(list, name): 839 def getname(name):
826 pkg = '%s%s' % (name, postfix) 840 return '%s%s' % (name, postfix)
827 if not pkg in list:
828 if packaged(pkg, d):
829 list.append(pkg)
830 841
831 base = pkg[:-len(postfix)] 842 base = pkg[:-len(postfix)]
832 if pkg.endswith(postfix): 843 if pkg.endswith(postfix):
833 pkg_addrrecs(pkg, base, func, d) 844 pkg_addrrecs(pkg, base, getname, rdepends, d)
834 continue
835 845
836 for prefix in prefixes: 846 for prefix in prefixes:
837 def func(list, name): 847 def getname(name):
838 pkg = '%s%s' % (prefix, name) 848 return '%s%s' % (prefix, name)
839 if not pkg in list:
840 if packaged(pkg, d):
841 list.append(pkg)
842 849
843 base = pkg[len(prefix):] 850 base = pkg[len(prefix):]
844 if pkg.startswith(prefix): 851 if pkg.startswith(prefix):
845 pkg_addrrecs(pkg, base, func, d) 852 pkg_addrrecs(pkg, base, getname, rdepends, d)
846} 853}
847 854
848 855