summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/package.bbclass16
1 files changed, 13 insertions, 3 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 648297ad25..0b5cf47749 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -614,7 +614,7 @@ def copydebugsources(debugsrcdir, sources, d):
614# Package data handling routines 614# Package data handling routines
615# 615#
616 616
617def get_package_mapping (pkg, basepkg, d): 617def get_package_mapping (pkg, basepkg, d, depversions=None):
618 import oe.packagedata 618 import oe.packagedata
619 619
620 data = oe.packagedata.read_subpkgdata(pkg, d) 620 data = oe.packagedata.read_subpkgdata(pkg, d)
@@ -625,6 +625,14 @@ def get_package_mapping (pkg, basepkg, d):
625 if bb.data.inherits_class('allarch', d) and not d.getVar('MULTILIB_VARIANTS') \ 625 if bb.data.inherits_class('allarch', d) and not d.getVar('MULTILIB_VARIANTS') \
626 and data[key] == basepkg: 626 and data[key] == basepkg:
627 return pkg 627 return pkg
628 if depversions == []:
629 # Avoid returning a mapping if the renamed package rprovides its original name
630 rprovkey = "RPROVIDES_%s" % pkg
631 if rprovkey in data:
632 if pkg in bb.utils.explode_dep_versions2(data[rprovkey]):
633 bb.note("%s rprovides %s, not replacing the latter" % (data[key], pkg))
634 return pkg
635 # Do map to rewritten package name
628 return data[key] 636 return data[key]
629 637
630 return pkg 638 return pkg
@@ -645,8 +653,10 @@ def runtime_mapping_rename (varname, pkg, d):
645 653
646 new_depends = {} 654 new_depends = {}
647 deps = bb.utils.explode_dep_versions2(d.getVar(varname) or "") 655 deps = bb.utils.explode_dep_versions2(d.getVar(varname) or "")
648 for depend in deps: 656 for depend, depversions in deps.items():
649 new_depend = get_package_mapping(depend, pkg, d) 657 new_depend = get_package_mapping(depend, pkg, d, depversions)
658 if depend != new_depend:
659 bb.note("package name mapping done: %s -> %s" % (depend, new_depend))
650 new_depends[new_depend] = deps[depend] 660 new_depends[new_depend] = deps[depend]
651 661
652 d.setVar(varname, bb.utils.join_deps(new_depends, commasep=False)) 662 d.setVar(varname, bb.utils.join_deps(new_depends, commasep=False))