From 3c5eae8fec67fd733fb5662097f6cd509e8274fc Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 2 Oct 2008 19:57:34 +0000 Subject: package_rpm.bbclass: Improve handling of '-' characters in Requires and Recommends fields git-svn-id: https://svn.o-hand.com/repos/poky/trunk@5390 311d38ba-8fff-0310-9ca6-ca027cbcb966 --- meta/classes/package_rpm.bbclass | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) (limited to 'meta') diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass index ae87bbff0..c676baa13 100644 --- a/meta/classes/package_rpm.bbclass +++ b/meta/classes/package_rpm.bbclass @@ -79,23 +79,24 @@ python write_specfile() { fd.write("AutoReqProv: no\n") bb.build.exec_func("mapping_rename_hook", d) - rdepends = bb.utils.explode_dep_versions(bb.data.getVar('RDEPENDS', d, True) or "") - for dep in rdepends: - ver = rdepends[dep] - if dep and ver: - ver = ver.replace('-', '+') - fd.write("Requires: %s %s\n" % (dep, ver)) - elif dep: - fd.write("Requires: %s\n" % (dep)) - - rdepends = bb.utils.explode_dep_versions(bb.data.getVar('RRECOMMENDS', d, True) or "") - for dep in rdepends: - ver = rdepends[dep] - if dep and ver: - ver = ver.replace('-', '+') - fd.write("Recommends: %s %s\n" % (dep, ver)) - elif dep: - fd.write("Recommends: %s\n" % (dep)) + + def write_dep_field(varname, outstring): + depends = bb.utils.explode_dep_versions(bb.data.getVar(varname, d, True) or "") + for dep in depends: + ver = depends[dep] + if dep and ver: + if '-' in ver: + subd = read_subpkgdata_dict(dep, d) + pv = subd['PV'] + reppv = pv.replace('-', '+') + ver = ver.replace(pv, reppv) + fd.write("%s: %s %s\n" % (outstring, dep, ver)) + elif dep: + fd.write("%s: %s\n" % (outstring, dep)) + + + write_dep_field('RDEPENDS', 'Requires') + write_dep_field('RRECOMMENDS', 'Recommends') fd.write("Summary\t: .\n") -- cgit v1.2.3