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 /meta/classes/package_rpm.bbclass | |
parent | 6e62524f3780f20eea282fa3aa5f0a30c3d0b8b6 (diff) | |
download | poky-3c5eae8fec67fd733fb5662097f6cd509e8274fc.tar.gz |
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
Diffstat (limited to 'meta/classes/package_rpm.bbclass')
-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 ae87bbff03..c676baa131 100644 --- a/meta/classes/package_rpm.bbclass +++ b/meta/classes/package_rpm.bbclass | |||
@@ -79,23 +79,24 @@ python write_specfile() { | |||
79 | fd.write("AutoReqProv: no\n") | 79 | fd.write("AutoReqProv: no\n") |
80 | 80 | ||
81 | bb.build.exec_func("mapping_rename_hook", d) | 81 | bb.build.exec_func("mapping_rename_hook", d) |
82 | rdepends = bb.utils.explode_dep_versions(bb.data.getVar('RDEPENDS', d, True) or "") | 82 | |
83 | for dep in rdepends: | 83 | def write_dep_field(varname, outstring): |
84 | ver = rdepends[dep] | 84 | depends = bb.utils.explode_dep_versions(bb.data.getVar(varname, d, True) or "") |
85 | if dep and ver: | 85 | for dep in depends: |
86 | ver = ver.replace('-', '+') | 86 | ver = depends[dep] |
87 | fd.write("Requires: %s %s\n" % (dep, ver)) | 87 | if dep and ver: |
88 | elif dep: | 88 | if '-' in ver: |
89 | fd.write("Requires: %s\n" % (dep)) | 89 | subd = read_subpkgdata_dict(dep, d) |
90 | 90 | pv = subd['PV'] | |
91 | rdepends = bb.utils.explode_dep_versions(bb.data.getVar('RRECOMMENDS', d, True) or "") | 91 | reppv = pv.replace('-', '+') |
92 | for dep in rdepends: | 92 | ver = ver.replace(pv, reppv) |
93 | ver = rdepends[dep] | 93 | fd.write("%s: %s %s\n" % (outstring, dep, ver)) |
94 | if dep and ver: | 94 | elif dep: |
95 | ver = ver.replace('-', '+') | 95 | fd.write("%s: %s\n" % (outstring, dep)) |
96 | fd.write("Recommends: %s %s\n" % (dep, ver)) | 96 | |
97 | elif dep: | 97 | |
98 | fd.write("Recommends: %s\n" % (dep)) | 98 | write_dep_field('RDEPENDS', 'Requires') |
99 | write_dep_field('RRECOMMENDS', 'Recommends') | ||
99 | 100 | ||
100 | fd.write("Summary\t: .\n") | 101 | fd.write("Summary\t: .\n") |
101 | 102 | ||