diff options
author | Richard Purdie <richard@openedhand.com> | 2008-10-02 20:56:59 +0000 |
---|---|---|
committer | Richard Purdie <richard@openedhand.com> | 2008-10-02 20:56:59 +0000 |
commit | 785f33dfaaefe8b6300a01a8a2538eed6382ee85 (patch) | |
tree | f6ce412803f2b3dcf7dd68a1e0af2b1cc02ce86b /meta | |
parent | 8a49dd28cc68e419990395c7d4f5846617e91356 (diff) | |
download | poky-785f33dfaaefe8b6300a01a8a2538eed6382ee85.tar.gz |
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
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/package_rpm.bbclass | 21 |
1 files changed, 17 insertions, 4 deletions
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() { | |||
78 | 78 | ||
79 | fd.write("AutoReqProv: no\n") | 79 | fd.write("AutoReqProv: no\n") |
80 | 80 | ||
81 | bb.build.exec_func("mapping_rename_hook", d) | 81 | def fix_dep_versions(varname): |
82 | |||
83 | def write_dep_field(varname, outstring): | ||
84 | depends = bb.utils.explode_dep_versions(bb.data.getVar(varname, d, True) or "") | 82 | depends = bb.utils.explode_dep_versions(bb.data.getVar(varname, d, True) or "") |
83 | newdeps = [] | ||
85 | for dep in depends: | 84 | for dep in depends: |
86 | ver = depends[dep] | 85 | ver = depends[dep] |
87 | if dep and ver: | 86 | if dep and ver: |
@@ -90,11 +89,25 @@ python write_specfile() { | |||
90 | pv = subd['PV'] | 89 | pv = subd['PV'] |
91 | reppv = pv.replace('-', '+') | 90 | reppv = pv.replace('-', '+') |
92 | ver = ver.replace(pv, reppv) | 91 | ver = ver.replace(pv, reppv) |
92 | newdeps.append("%s (%s)" % (dep, ver)) | ||
93 | elif dep: | ||
94 | newdeps.append(dep) | ||
95 | bb.data.setVar(varname, ", ".join(newdeps), d) | ||
96 | |||
97 | fix_dep_versions('RDEPENDS') | ||
98 | fix_dep_versions('RRECOMMENDS') | ||
99 | |||
100 | bb.build.exec_func("mapping_rename_hook", d) | ||
101 | |||
102 | def write_dep_field(varname, outstring): | ||
103 | depends = bb.utils.explode_dep_versions(bb.data.getVar(varname, d, True) or "") | ||
104 | for dep in depends: | ||
105 | ver = depends[dep] | ||
106 | if dep and ver: | ||
93 | fd.write("%s: %s %s\n" % (outstring, dep, ver)) | 107 | fd.write("%s: %s %s\n" % (outstring, dep, ver)) |
94 | elif dep: | 108 | elif dep: |
95 | fd.write("%s: %s\n" % (outstring, dep)) | 109 | fd.write("%s: %s\n" % (outstring, dep)) |
96 | 110 | ||
97 | |||
98 | write_dep_field('RDEPENDS', 'Requires') | 111 | write_dep_field('RDEPENDS', 'Requires') |
99 | write_dep_field('RRECOMMENDS', 'Recommends') | 112 | write_dep_field('RRECOMMENDS', 'Recommends') |
100 | 113 | ||