summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2008-09-03 14:49:22 +0000
committerRichard Purdie <richard@openedhand.com>2008-09-03 14:49:22 +0000
commit6269c57167cd172d1fadb0d0efd50b953755e0cc (patch)
tree3e1d5fc6d8d7807b5605ffd8371e7b4a3ce36acd
parent5d24ea892f7c91771b0b703b14338baf8f3957fb (diff)
downloadopenembedded-core-6269c57167cd172d1fadb0d0efd50b953755e0cc.tar.gz
openembedded-core-6269c57167cd172d1fadb0d0efd50b953755e0cc.tar.bz2
openembedded-core-6269c57167cd172d1fadb0d0efd50b953755e0cc.zip
package_rpm.bbclass: Fix problems with package version with '-' in the version (replace with '+'), improve the Requires and Recommends generation code
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@5129 311d38ba-8fff-0310-9ca6-ca027cbcb966
-rw-r--r--meta/classes/package_rpm.bbclass32
1 files changed, 26 insertions, 6 deletions
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 5945c047b4..22604d2569 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -14,9 +14,14 @@ RPM="rpm ${RPMOPTS}"
python write_specfile() {
from bb import data, build
import sys
+
+ version = bb.data.getVar('PV', d, 1)
+ version = version.replace('-', '+')
+ bb.data.setVar('RPMPV', version, d)
+
out_vartranslate = {
"PKG": "Name",
- "PV": "Version",
+ "RPMPV": "Version",
"PR": "Release",
"DESCRIPTION": "%description",
"ROOT": "BuildRoot",
@@ -71,9 +76,24 @@ python write_specfile() {
fd.write("AutoReqProv: no\n")
bb.build.exec_func("mapping_rename_hook", d)
- rdepends = " ".join(bb.utils.explode_deps(bb.data.getVar('RDEPENDS', d, True) or ""))
- if rdepends:
- fd.write("Requires: %s\n" % rdepends)
+ 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))
+
fd.write("Summary\t: .\n")
for var in out_vartranslate.keys():
@@ -99,8 +119,8 @@ python write_specfile() {
bb.build.exec_func('BUILDSPEC', d)
# move the rpm into the pkgoutdir
- rpm = bb.data.expand('${RPMBUILDPATH}/RPMS/${TARGET_ARCH}/${PKG}-${PV}-${PR}.${TARGET_ARCH}.rpm', d)
- outrpm = bb.data.expand('${DEPLOY_DIR_RPM}/${PKG}-${PV}-${PR}.${TARGET_ARCH}.rpm', d)
+ rpm = bb.data.expand('${RPMBUILDPATH}/RPMS/${TARGET_ARCH}/${PKG}-${RPMPV}-${PR}.${TARGET_ARCH}.rpm', d)
+ outrpm = bb.data.expand('${DEPLOY_DIR_RPM}/${PKG}-${RPMPV}-${PR}.${TARGET_ARCH}.rpm', d)
bb.movefile(rpm, outrpm)
}