summaryrefslogtreecommitdiff
path: root/meta/classes/package_rpm.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/package_rpm.bbclass')
-rw-r--r--meta/classes/package_rpm.bbclass21
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() {
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')