summaryrefslogtreecommitdiffstats
path: root/meta/classes/package_rpm.bbclass
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2011-06-20 19:08:19 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-06-23 16:02:40 +0100
commitb97b3e85ac0e428977c04d89d0f60be9822814d7 (patch)
tree5a9c0947585ea019436ef98408064fac30d5e5e1 /meta/classes/package_rpm.bbclass
parent2b8a68001ada2885f15ca68aa7c94cc92bb36973 (diff)
downloadpoky-b97b3e85ac0e428977c04d89d0f60be9822814d7.tar.gz
classes/package_rpm.bbclass: Change the way the PV is transformed
There were some odd instances where the PKGV could not be loaded in the old way. Change to verify that PKGV exists before attempting to retrieve the value from the key. (From OE-Core rev: c2ce3573fb2816cd2023a56b364fae4c0f4455ae) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/package_rpm.bbclass')
-rw-r--r--meta/classes/package_rpm.bbclass23
1 files changed, 18 insertions, 5 deletions
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 9a854f3834..2cc57424c7 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -318,8 +318,20 @@ python write_specfile () {
318 import textwrap 318 import textwrap
319 import oe.packagedata 319 import oe.packagedata
320 320
321 # We need to change '-' in a version field to '+' 321 # In RPM, dependencies are of the format: pkg <>= Epoch:Version-Release
322 # This needs to be done BEFORE the mapping_rename_hook 322 # This format is similar to OE, however there are restrictions on the
323 # characters that can be in a field. In the Version field, "-"
324 # characters are not allowed. "-" is allowed in the Release field.
325 #
326 # We translate the "-" in the version to a "+", by loading the PKGV
327 # from the dependent recipe, replacing the - with a +, and then using
328 # that value to do a replace inside of this recipe's dependencies.
329 # This preserves the "-" separator between the version and release, as
330 # well as any "-" characters inside of the release field.
331 #
332 # All of this has to happen BEFORE the mapping_rename_hook as
333 # after renaming we cannot look up the dependencies in the packagedata
334 # store.
323 def translate_vers(varname, d): 335 def translate_vers(varname, d):
324 depends = bb.data.getVar(varname, d, True) 336 depends = bb.data.getVar(varname, d, True)
325 if depends: 337 if depends:
@@ -330,9 +342,10 @@ python write_specfile () {
330 if dep and ver: 342 if dep and ver:
331 if '-' in ver: 343 if '-' in ver:
332 subd = oe.packagedata.read_subpkgdata_dict(dep, d) 344 subd = oe.packagedata.read_subpkgdata_dict(dep, d)
333 pv = subd['PKGV'] 345 if 'PKGV' in subd:
334 reppv = pv.replace('-', '+') 346 pv = subd['PKGV']
335 ver = ver.replace(pv, reppv) 347 reppv = pv.replace('-', '+')
348 ver = ver.replace(pv, reppv)
336 newdeps_dict[dep] = ver 349 newdeps_dict[dep] = ver
337 depends = bb.utils.join_deps(newdeps_dict) 350 depends = bb.utils.join_deps(newdeps_dict)
338 bb.data.setVar(varname, depends.strip(), d) 351 bb.data.setVar(varname, depends.strip(), d)