diff options
author | Richard Purdie <richard@openedhand.com> | 2008-10-02 19:57:34 +0000 |
---|---|---|
committer | Richard Purdie <richard@openedhand.com> | 2008-10-02 19:57:34 +0000 |
commit | 3c5eae8fec67fd733fb5662097f6cd509e8274fc (patch) | |
tree | d7709dfb4fbad27e7ec9939c8294e7b292ef5847 | |
parent | 6e62524f3780f20eea282fa3aa5f0a30c3d0b8b6 (diff) | |
download | openembedded-core-3c5eae8fec67fd733fb5662097f6cd509e8274fc.tar.gz openembedded-core-3c5eae8fec67fd733fb5662097f6cd509e8274fc.tar.bz2 openembedded-core-3c5eae8fec67fd733fb5662097f6cd509e8274fc.tar.xz openembedded-core-3c5eae8fec67fd733fb5662097f6cd509e8274fc.zip |
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
-rw-r--r-- | meta/classes/package_rpm.bbclass | 35 |
1 files changed, 18 insertions, 17 deletions
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") |