diff options
-rw-r--r-- | meta/classes/package_rpm.bbclass | 23 |
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) |