From 785f33dfaaefe8b6300a01a8a2538eed6382ee85 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 2 Oct 2008 20:56:59 +0000 Subject: package_rpm.bbclass: Fix package version fixing for PKG renamed packages git-svn-id: https://svn.o-hand.com/repos/poky/trunk@5393 311d38ba-8fff-0310-9ca6-ca027cbcb966 --- meta/classes/package_rpm.bbclass | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'meta/classes') diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass index c676baa131..4b021ca354 100644 --- a/meta/classes/package_rpm.bbclass +++ b/meta/classes/package_rpm.bbclass @@ -78,10 +78,9 @@ python write_specfile() { fd.write("AutoReqProv: no\n") - bb.build.exec_func("mapping_rename_hook", d) - - def write_dep_field(varname, outstring): + def fix_dep_versions(varname): depends = bb.utils.explode_dep_versions(bb.data.getVar(varname, d, True) or "") + newdeps = [] for dep in depends: ver = depends[dep] if dep and ver: @@ -90,11 +89,25 @@ python write_specfile() { pv = subd['PV'] reppv = pv.replace('-', '+') ver = ver.replace(pv, reppv) + newdeps.append("%s (%s)" % (dep, ver)) + elif dep: + newdeps.append(dep) + bb.data.setVar(varname, ", ".join(newdeps), d) + + fix_dep_versions('RDEPENDS') + fix_dep_versions('RRECOMMENDS') + + bb.build.exec_func("mapping_rename_hook", d) + + 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: 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') -- cgit v1.2.3