summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-10-02 11:37:07 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-10-02 11:40:53 +0100
commit5fdbda6922327d963d4fe1c597fed8f0dfd20ed1 (patch)
tree98e3a58efeaead2fa76110b571cfda3f63414277 /meta/classes
parent0bfb2094e3eadc85358a354d12b211ff69612a61 (diff)
downloadpoky-5fdbda6922327d963d4fe1c597fed8f0dfd20ed1.tar.gz
classes: Update to use corrected bb.utils.explode_dep_versions2 API
The bb.utils.explode_dep_versions function has issues where dependency information can be lost. The API doesn't support maintaining the correct information so this changes to use a new function which correctly handles the data. This patch also fixes various points in the code to ensure that we do not have any duplicates in things that use explode_dep_versions. A new sanity test to test the contents of the R* variables is also added. [Some changes from Mark Hatle <mark.hatle@windriver.com>] (From OE-Core rev: 16a892431d0c0d03f8b561b92909cf2f11af4918) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/insane.bbclass44
-rw-r--r--meta/classes/kernel.bbclass12
-rw-r--r--meta/classes/multilib.bbclass4
-rw-r--r--meta/classes/package.bbclass48
-rw-r--r--meta/classes/package_deb.bbclass21
-rw-r--r--meta/classes/package_ipk.bbclass21
-rw-r--r--meta/classes/package_rpm.bbclass84
7 files changed, 142 insertions, 92 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index b1e68b23fc..4f87c937ad 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -114,7 +114,7 @@ def package_qa_get_machine_dict():
114 114
115# Currently not being used by default "desktop" 115# Currently not being used by default "desktop"
116WARN_QA ?= "ldflags useless-rpaths rpaths unsafe-references-in-binaries unsafe-references-in-scripts staticdev libdir" 116WARN_QA ?= "ldflags useless-rpaths rpaths unsafe-references-in-binaries unsafe-references-in-scripts staticdev libdir"
117ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch la2 pkgconfig la perms" 117ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch la2 pkgconfig la perms dep-cmp"
118 118
119ALL_QA = "${WARN_QA} ${ERROR_QA}" 119ALL_QA = "${WARN_QA} ${ERROR_QA}"
120 120
@@ -646,6 +646,43 @@ def package_qa_check_rdepends(pkg, pkgdest, skip, d):
646 646
647 return sane 647 return sane
648 648
649def package_qa_check_deps(pkg, pkgdest, skip, d):
650 sane = True
651
652 localdata = bb.data.createCopy(d)
653 localdata.setVar('OVERRIDES', pkg)
654 bb.data.update_data(localdata)
655
656 def check_valid_deps(var):
657 sane = True
658 try:
659 rvar = bb.utils.explode_dep_versions2(localdata.getVar(var, True) or "")
660 except ValueError as e:
661 bb.fatal("%s_%s: %s" % (var, pkg, e))
662 raise e
663 for dep in rvar:
664 for v in rvar[dep]:
665 if v and not v.startswith(('< ', '= ', '> ', '<= ', '>=')):
666 error_msg = "%s_%s is invalid: %s (%s) only comparisons <, =, >, <=, and >= are allowed" % (var, pkg, dep, v)
667 sane = package_qa_handle_error("dep-cmp", error_msg, d)
668 return sane
669
670 sane = True
671 if not check_valid_deps('RDEPENDS'):
672 sane = False
673 if not check_valid_deps('RRECOMMENDS'):
674 sane = False
675 if not check_valid_deps('RSUGGESTS'):
676 sane = False
677 if not check_valid_deps('RPROVIDES'):
678 sane = False
679 if not check_valid_deps('RREPLACES'):
680 sane = False
681 if not check_valid_deps('RCONFLICTS'):
682 sane = False
683
684 return sane
685
649# The PACKAGE FUNC to scan each package 686# The PACKAGE FUNC to scan each package
650python do_package_qa () { 687python do_package_qa () {
651 import subprocess 688 import subprocess
@@ -686,6 +723,7 @@ python do_package_qa () {
686 g = globals() 723 g = globals()
687 walk_sane = True 724 walk_sane = True
688 rdepends_sane = True 725 rdepends_sane = True
726 deps_sane = True
689 for package in packages.split(): 727 for package in packages.split():
690 skip = (d.getVar('INSANE_SKIP_' + package, True) or "").split() 728 skip = (d.getVar('INSANE_SKIP_' + package, True) or "").split()
691 if skip: 729 if skip:
@@ -709,12 +747,14 @@ python do_package_qa () {
709 walk_sane = False 747 walk_sane = False
710 if not package_qa_check_rdepends(package, pkgdest, skip, d): 748 if not package_qa_check_rdepends(package, pkgdest, skip, d):
711 rdepends_sane = False 749 rdepends_sane = False
750 if not package_qa_check_deps(package, pkgdest, skip, d):
751 deps_sane = False
712 752
713 753
714 if 'libdir' in d.getVar("ALL_QA", True).split(): 754 if 'libdir' in d.getVar("ALL_QA", True).split():
715 package_qa_check_libdir(d) 755 package_qa_check_libdir(d)
716 756
717 if not walk_sane or not rdepends_sane: 757 if not walk_sane or not rdepends_sane or not deps_sane:
718 bb.fatal("QA run found fatal errors. Please consider fixing them.") 758 bb.fatal("QA run found fatal errors. Please consider fixing them.")
719 bb.note("DONE with PACKAGE QA") 759 bb.note("DONE with PACKAGE QA")
720} 760}
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index fdef1bea97..36bc3c7cf4 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -429,13 +429,11 @@ python populate_packages_prepend () {
429 old_desc = d.getVar('DESCRIPTION_' + pkg, True) or "" 429 old_desc = d.getVar('DESCRIPTION_' + pkg, True) or ""
430 d.setVar('DESCRIPTION_' + pkg, old_desc + "; " + vals["description"]) 430 d.setVar('DESCRIPTION_' + pkg, old_desc + "; " + vals["description"])
431 431
432 rdepends_str = d.getVar('RDEPENDS_' + pkg, True) 432 rdepends = bb.utils.explode_dep_versions2(d.getVar('RDEPENDS_' + pkg, True) or "")
433 if rdepends_str: 433 for dep in get_dependencies(file, pattern, format):
434 rdepends = rdepends_str.split() 434 if not dep in rdepends:
435 else: 435 rdepends[dep] = []
436 rdepends = [] 436 d.setVar('RDEPENDS_' + pkg, bb.utils.join_deps(rdepends, commasep=False))
437 rdepends.extend(get_dependencies(file, pattern, format))
438 d.setVar('RDEPENDS_' + pkg, ' '.join(rdepends))
439 437
440 module_deps = parse_depmod() 438 module_deps = parse_depmod()
441 module_regex = '^(.*)\.k?o$' 439 module_regex = '^(.*)\.k?o$'
diff --git a/meta/classes/multilib.bbclass b/meta/classes/multilib.bbclass
index f162293da2..eaaad5fa62 100644
--- a/meta/classes/multilib.bbclass
+++ b/meta/classes/multilib.bbclass
@@ -85,9 +85,9 @@ PACKAGEFUNCS_append = "do_package_qa_multilib"
85python do_package_qa_multilib() { 85python do_package_qa_multilib() {
86 86
87 def check_mlprefix(pkg, var, mlprefix): 87 def check_mlprefix(pkg, var, mlprefix):
88 values = bb.utils.explode_dep_versions(d.getVar('%s_%s' % (var, pkg), True) or d.getVar(var, True) or "") 88 values = bb.utils.explode_deps(d.getVar('%s_%s' % (var, pkg), True) or d.getVar(var, True) or "")
89 candidates = [] 89 candidates = []
90 for i in values.keys(): 90 for i in values:
91 if i.startswith('virtual/'): 91 if i.startswith('virtual/'):
92 i = i[len('virtual/'):] 92 i = i[len('virtual/'):]
93 if (not i.startswith('kernel-module')) and (not i.startswith(mlprefix)): 93 if (not i.startswith('kernel-module')) and (not i.startswith(mlprefix)):
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index c8aafc9752..a14561d5ac 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -375,17 +375,13 @@ def get_package_mapping (pkg, d):
375def runtime_mapping_rename (varname, d): 375def runtime_mapping_rename (varname, d):
376 #bb.note("%s before: %s" % (varname, d.getVar(varname, True))) 376 #bb.note("%s before: %s" % (varname, d.getVar(varname, True)))
377 377
378 new_depends = [] 378 new_depends = {}
379 deps = bb.utils.explode_dep_versions(d.getVar(varname, True) or "") 379 deps = bb.utils.explode_dep_versions2(d.getVar(varname, True) or "")
380 for depend in deps: 380 for depend in deps:
381 # Have to be careful with any version component of the depend
382 new_depend = get_package_mapping(depend, d) 381 new_depend = get_package_mapping(depend, d)
383 if deps[depend]: 382 new_depends[new_depend] = deps[depend]
384 new_depends.append("%s (%s)" % (new_depend, deps[depend]))
385 else:
386 new_depends.append(new_depend)
387 383
388 d.setVar(varname, " ".join(new_depends) or None) 384 d.setVar(varname, bb.utils.join_deps(new_depends, commasep=False))
389 385
390 #bb.note("%s after: %s" % (varname, d.getVar(varname, True))) 386 #bb.note("%s after: %s" % (varname, d.getVar(varname, True)))
391 387
@@ -1078,7 +1074,7 @@ python populate_packages () {
1078 dangling_links[pkg].append(os.path.normpath(target)) 1074 dangling_links[pkg].append(os.path.normpath(target))
1079 1075
1080 for pkg in package_list: 1076 for pkg in package_list:
1081 rdepends = bb.utils.explode_dep_versions(d.getVar('RDEPENDS_' + pkg, True) or d.getVar('RDEPENDS', True) or "") 1077 rdepends = bb.utils.explode_dep_versions2(d.getVar('RDEPENDS_' + pkg, True) or d.getVar('RDEPENDS', True) or "")
1082 1078
1083 for l in dangling_links[pkg]: 1079 for l in dangling_links[pkg]:
1084 found = False 1080 found = False
@@ -1091,7 +1087,7 @@ python populate_packages () {
1091 if p == pkg: 1087 if p == pkg:
1092 break 1088 break
1093 if p not in rdepends: 1089 if p not in rdepends:
1094 rdepends[p] = "" 1090 rdepends[p] = []
1095 break 1091 break
1096 if found == False: 1092 if found == False:
1097 bb.note("%s contains dangling symlink to %s" % (pkg, l)) 1093 bb.note("%s contains dangling symlink to %s" % (pkg, l))
@@ -1637,14 +1633,19 @@ def read_libdep_files(d):
1637 pkglibdeps = {} 1633 pkglibdeps = {}
1638 packages = d.getVar('PACKAGES', True).split() 1634 packages = d.getVar('PACKAGES', True).split()
1639 for pkg in packages: 1635 for pkg in packages:
1640 pkglibdeps[pkg] = [] 1636 pkglibdeps[pkg] = {}
1641 for extension in ".shlibdeps", ".pcdeps", ".clilibdeps": 1637 for extension in ".shlibdeps", ".pcdeps", ".clilibdeps":
1642 depsfile = d.expand("${PKGDEST}/" + pkg + extension) 1638 depsfile = d.expand("${PKGDEST}/" + pkg + extension)
1643 if os.access(depsfile, os.R_OK): 1639 if os.access(depsfile, os.R_OK):
1644 fd = file(depsfile) 1640 fd = file(depsfile)
1645 lines = fd.readlines() 1641 lines = fd.readlines()
1646 fd.close() 1642 fd.close()
1647 pkglibdeps[pkg].extend([l.rstrip() for l in lines]) 1643 for l in lines:
1644 l.rstrip()
1645 deps = bb.utils.explode_dep_versions2(l)
1646 for dep in deps:
1647 if not dep in pkglibdeps[pkg]:
1648 pkglibdeps[pkg][dep] = deps[dep]
1648 return pkglibdeps 1649 return pkglibdeps
1649 1650
1650python read_shlibdeps () { 1651python read_shlibdeps () {
@@ -1652,9 +1653,14 @@ python read_shlibdeps () {
1652 1653
1653 packages = d.getVar('PACKAGES', True).split() 1654 packages = d.getVar('PACKAGES', True).split()
1654 for pkg in packages: 1655 for pkg in packages:
1655 rdepends = bb.utils.explode_dep_versions(d.getVar('RDEPENDS_' + pkg, False) or d.getVar('RDEPENDS', False) or "") 1656 rdepends = bb.utils.explode_dep_versions2(d.getVar('RDEPENDS_' + pkg, False) or d.getVar('RDEPENDS', False) or "")
1656 for dep in pkglibdeps[pkg]: 1657 for dep in pkglibdeps[pkg]:
1657 rdepends[dep] = "" 1658 # Add the dep if it's not already there, or if no comparison is set
1659 if dep not in rdepends:
1660 rdepends[dep] = []
1661 for v in pkglibdeps[pkg][dep]:
1662 if v not in rdepends[dep]:
1663 rdepends[dep].append(v)
1658 d.setVar('RDEPENDS_' + pkg, bb.utils.join_deps(rdepends, commasep=False)) 1664 d.setVar('RDEPENDS_' + pkg, bb.utils.join_deps(rdepends, commasep=False))
1659} 1665}
1660 1666
@@ -1679,7 +1685,7 @@ python package_depchains() {
1679 def pkg_adddeprrecs(pkg, base, suffix, getname, depends, d): 1685 def pkg_adddeprrecs(pkg, base, suffix, getname, depends, d):
1680 1686
1681 #bb.note('depends for %s is %s' % (base, depends)) 1687 #bb.note('depends for %s is %s' % (base, depends))
1682 rreclist = bb.utils.explode_dep_versions(d.getVar('RRECOMMENDS_' + pkg, True) or d.getVar('RRECOMMENDS', True) or "") 1688 rreclist = bb.utils.explode_dep_versions2(d.getVar('RRECOMMENDS_' + pkg, True) or d.getVar('RRECOMMENDS', True) or "")
1683 1689
1684 for depend in depends: 1690 for depend in depends:
1685 if depend.find('-native') != -1 or depend.find('-cross') != -1 or depend.startswith('virtual/'): 1691 if depend.find('-native') != -1 or depend.find('-cross') != -1 or depend.startswith('virtual/'):
@@ -1692,7 +1698,7 @@ python package_depchains() {
1692 pkgname = getname(depend, suffix) 1698 pkgname = getname(depend, suffix)
1693 #bb.note("Adding %s for %s" % (pkgname, depend)) 1699 #bb.note("Adding %s for %s" % (pkgname, depend))
1694 if pkgname not in rreclist and pkgname != pkg: 1700 if pkgname not in rreclist and pkgname != pkg:
1695 rreclist[pkgname] = "" 1701 rreclist[pkgname] = []
1696 1702
1697 #bb.note('setting: RRECOMMENDS_%s=%s' % (pkg, ' '.join(rreclist))) 1703 #bb.note('setting: RRECOMMENDS_%s=%s' % (pkg, ' '.join(rreclist)))
1698 d.setVar('RRECOMMENDS_%s' % pkg, bb.utils.join_deps(rreclist, commasep=False)) 1704 d.setVar('RRECOMMENDS_%s' % pkg, bb.utils.join_deps(rreclist, commasep=False))
@@ -1700,7 +1706,7 @@ python package_depchains() {
1700 def pkg_addrrecs(pkg, base, suffix, getname, rdepends, d): 1706 def pkg_addrrecs(pkg, base, suffix, getname, rdepends, d):
1701 1707
1702 #bb.note('rdepends for %s is %s' % (base, rdepends)) 1708 #bb.note('rdepends for %s is %s' % (base, rdepends))
1703 rreclist = bb.utils.explode_dep_versions(d.getVar('RRECOMMENDS_' + pkg, True) or d.getVar('RRECOMMENDS', True) or "") 1709 rreclist = bb.utils.explode_dep_versions2(d.getVar('RRECOMMENDS_' + pkg, True) or d.getVar('RRECOMMENDS', True) or "")
1704 1710
1705 for depend in rdepends: 1711 for depend in rdepends:
1706 if depend.find('virtual-locale-') != -1: 1712 if depend.find('virtual-locale-') != -1:
@@ -1713,13 +1719,12 @@ python package_depchains() {
1713 pkgname = getname(depend, suffix) 1719 pkgname = getname(depend, suffix)
1714 #bb.note("Adding %s for %s" % (pkgname, depend)) 1720 #bb.note("Adding %s for %s" % (pkgname, depend))
1715 if pkgname not in rreclist and pkgname != pkg: 1721 if pkgname not in rreclist and pkgname != pkg:
1716 rreclist[pkgname] = "" 1722 rreclist[pkgname] = []
1717 1723
1718 #bb.note('setting: RRECOMMENDS_%s=%s' % (pkg, ' '.join(rreclist))) 1724 #bb.note('setting: RRECOMMENDS_%s=%s' % (pkg, ' '.join(rreclist)))
1719 d.setVar('RRECOMMENDS_%s' % pkg, bb.utils.join_deps(rreclist, commasep=False)) 1725 d.setVar('RRECOMMENDS_%s' % pkg, bb.utils.join_deps(rreclist, commasep=False))
1720 1726
1721 def add_dep(list, dep): 1727 def add_dep(list, dep):
1722 dep = dep.split(' (')[0].strip()
1723 if dep not in list: 1728 if dep not in list:
1724 list.append(dep) 1729 list.append(dep)
1725 1730
@@ -1758,10 +1763,7 @@ python package_depchains() {
1758 1763
1759 if "-dbg" in pkgs: 1764 if "-dbg" in pkgs:
1760 pkglibdeps = read_libdep_files(d) 1765 pkglibdeps = read_libdep_files(d)
1761 pkglibdeplist = [] 1766 pkglibdeplist = pkglibdeps.keys()
1762 for pkg in pkglibdeps:
1763 for dep in pkglibdeps[pkg]:
1764 add_dep(pkglibdeplist, dep)
1765 # FIXME this should not look at PN once all task recipes inherit from task.bbclass 1767 # FIXME this should not look at PN once all task recipes inherit from task.bbclass
1766 dbgdefaultdeps = ((d.getVar('DEPCHAIN_DBGDEFAULTDEPS', True) == '1') or (d.getVar('PN', True) or '').startswith('packagegroup-')) 1768 dbgdefaultdeps = ((d.getVar('DEPCHAIN_DBGDEFAULTDEPS', True) == '1') or (d.getVar('PN', True) or '').startswith('packagegroup-'))
1767 1769
diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass
index a25e5d783e..d273cb0f84 100644
--- a/meta/classes/package_deb.bbclass
+++ b/meta/classes/package_deb.bbclass
@@ -341,28 +341,29 @@ python do_package_deb () {
341 # adjust these to the '<<' and '>>' equivalents 341 # adjust these to the '<<' and '>>' equivalents
342 # 342 #
343 for dep in var: 343 for dep in var:
344 if (var[dep] or "").startswith("< "): 344 for i, v in enumerate(var[dep]):
345 var[dep] = var[dep].replace("< ", "<< ") 345 if (v or "").startswith("< "):
346 elif (var[dep] or "").startswith("> "): 346 var[dep][i] = var[dep][i].replace("< ", "<< ")
347 var[dep] = var[dep].replace("> ", ">> ") 347 elif (v or "").startswith("> "):
348 var[dep][i] = var[dep][i].replace("> ", ">> ")
348 349
349 rdepends = bb.utils.explode_dep_versions(localdata.getVar("RDEPENDS", True) or "") 350 rdepends = bb.utils.explode_dep_versions2(localdata.getVar("RDEPENDS", True) or "")
350 debian_cmp_remap(rdepends) 351 debian_cmp_remap(rdepends)
351 for dep in rdepends: 352 for dep in rdepends:
352 if '*' in dep: 353 if '*' in dep:
353 del rdepends[dep] 354 del rdepends[dep]
354 rrecommends = bb.utils.explode_dep_versions(localdata.getVar("RRECOMMENDS", True) or "") 355 rrecommends = bb.utils.explode_dep_versions2(localdata.getVar("RRECOMMENDS", True) or "")
355 debian_cmp_remap(rrecommends) 356 debian_cmp_remap(rrecommends)
356 for dep in rrecommends: 357 for dep in rrecommends:
357 if '*' in dep: 358 if '*' in dep:
358 del rrecommends[dep] 359 del rrecommends[dep]
359 rsuggests = bb.utils.explode_dep_versions(localdata.getVar("RSUGGESTS", True) or "") 360 rsuggests = bb.utils.explode_dep_versions2(localdata.getVar("RSUGGESTS", True) or "")
360 debian_cmp_remap(rsuggests) 361 debian_cmp_remap(rsuggests)
361 rprovides = bb.utils.explode_dep_versions(localdata.getVar("RPROVIDES", True) or "") 362 rprovides = bb.utils.explode_dep_versions2(localdata.getVar("RPROVIDES", True) or "")
362 debian_cmp_remap(rprovides) 363 debian_cmp_remap(rprovides)
363 rreplaces = bb.utils.explode_dep_versions(localdata.getVar("RREPLACES", True) or "") 364 rreplaces = bb.utils.explode_dep_versions2(localdata.getVar("RREPLACES", True) or "")
364 debian_cmp_remap(rreplaces) 365 debian_cmp_remap(rreplaces)
365 rconflicts = bb.utils.explode_dep_versions(localdata.getVar("RCONFLICTS", True) or "") 366 rconflicts = bb.utils.explode_dep_versions2(localdata.getVar("RCONFLICTS", True) or "")
366 debian_cmp_remap(rconflicts) 367 debian_cmp_remap(rconflicts)
367 if rdepends: 368 if rdepends:
368 ctrlfile.write("Depends: %s\n" % unicode(bb.utils.join_deps(rdepends))) 369 ctrlfile.write("Depends: %s\n" % unicode(bb.utils.join_deps(rdepends)))
diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index 281ce596d5..019bd7cc19 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -379,22 +379,23 @@ python do_package_ipk () {
379 # adjust these to the '<<' and '>>' equivalents 379 # adjust these to the '<<' and '>>' equivalents
380 # 380 #
381 for dep in var: 381 for dep in var:
382 if (var[dep] or "").startswith("< "): 382 for i, v in enumerate(var[dep]):
383 var[dep] = var[dep].replace("< ", "<< ") 383 if (v or "").startswith("< "):
384 elif (var[dep] or "").startswith("> "): 384 var[dep][i] = var[dep][i].replace("< ", "<< ")
385 var[dep] = var[dep].replace("> ", ">> ") 385 elif (v or "").startswith("> "):
386 var[dep][i] = var[dep][i].replace("> ", ">> ")
386 387
387 rdepends = bb.utils.explode_dep_versions(localdata.getVar("RDEPENDS", True) or "") 388 rdepends = bb.utils.explode_dep_versions2(localdata.getVar("RDEPENDS", True) or "")
388 debian_cmp_remap(rdepends) 389 debian_cmp_remap(rdepends)
389 rrecommends = bb.utils.explode_dep_versions(localdata.getVar("RRECOMMENDS", True) or "") 390 rrecommends = bb.utils.explode_dep_versions2(localdata.getVar("RRECOMMENDS", True) or "")
390 debian_cmp_remap(rrecommends) 391 debian_cmp_remap(rrecommends)
391 rsuggests = bb.utils.explode_dep_versions(localdata.getVar("RSUGGESTS", True) or "") 392 rsuggests = bb.utils.explode_dep_versions2(localdata.getVar("RSUGGESTS", True) or "")
392 debian_cmp_remap(rsuggests) 393 debian_cmp_remap(rsuggests)
393 rprovides = bb.utils.explode_dep_versions(localdata.getVar("RPROVIDES", True) or "") 394 rprovides = bb.utils.explode_dep_versions2(localdata.getVar("RPROVIDES", True) or "")
394 debian_cmp_remap(rprovides) 395 debian_cmp_remap(rprovides)
395 rreplaces = bb.utils.explode_dep_versions(localdata.getVar("RREPLACES", True) or "") 396 rreplaces = bb.utils.explode_dep_versions2(localdata.getVar("RREPLACES", True) or "")
396 debian_cmp_remap(rreplaces) 397 debian_cmp_remap(rreplaces)
397 rconflicts = bb.utils.explode_dep_versions(localdata.getVar("RCONFLICTS", True) or "") 398 rconflicts = bb.utils.explode_dep_versions2(localdata.getVar("RCONFLICTS", True) or "")
398 debian_cmp_remap(rconflicts) 399 debian_cmp_remap(rconflicts)
399 400
400 if rdepends: 401 if rdepends:
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 49055f2f51..c491775976 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -608,6 +608,13 @@ python write_specfile () {
608 name = "".join(name.split(eext[1] + '-')) 608 name = "".join(name.split(eext[1] + '-'))
609 return name 609 return name
610 610
611 def strip_multilib_deps(deps, d):
612 depends = bb.utils.explode_dep_versions2(deps or "")
613 newdeps = {}
614 for dep in depends:
615 newdeps[strip_multilib(dep, d)] = depends[dep]
616 return bb.utils.join_deps(newdeps)
617
611# ml = d.getVar("MLPREFIX", True) 618# ml = d.getVar("MLPREFIX", True)
612# if ml and name and len(ml) != 0 and name.find(ml) == 0: 619# if ml and name and len(ml) != 0 and name.find(ml) == 0:
613# return ml.join(name.split(ml, 1)[1:]) 620# return ml.join(name.split(ml, 1)[1:])
@@ -630,18 +637,20 @@ python write_specfile () {
630 def translate_vers(varname, d): 637 def translate_vers(varname, d):
631 depends = d.getVar(varname, True) 638 depends = d.getVar(varname, True)
632 if depends: 639 if depends:
633 depends_dict = bb.utils.explode_dep_versions(depends) 640 depends_dict = bb.utils.explode_dep_versions2(depends)
634 newdeps_dict = {} 641 newdeps_dict = {}
635 for dep in depends_dict: 642 for dep in depends_dict:
636 ver = depends_dict[dep] 643 verlist = []
637 if dep and ver: 644 for ver in depends_dict[dep]:
638 if '-' in ver: 645 if '-' in ver:
639 subd = oe.packagedata.read_subpkgdata_dict(dep, d) 646 subd = oe.packagedata.read_subpkgdata_dict(dep, d)
640 if 'PKGV' in subd: 647 if 'PKGV' in subd:
641 pv = subd['PKGV'] 648 pv = subd['PKGV']
642 reppv = pv.replace('-', '+') 649 reppv = pv.replace('-', '+')
643 ver = ver.replace(pv, reppv) 650 verlist.append(ver.replace(pv, reppv))
644 newdeps_dict[dep] = ver 651 else:
652 verlist.append(ver)
653 newdeps_dict[dep] = verlist
645 depends = bb.utils.join_deps(newdeps_dict) 654 depends = bb.utils.join_deps(newdeps_dict)
646 d.setVar(varname, depends.strip()) 655 d.setVar(varname, depends.strip())
647 656
@@ -650,14 +659,13 @@ python write_specfile () {
650 def print_deps(variable, tag, array, d): 659 def print_deps(variable, tag, array, d):
651 depends = variable 660 depends = variable
652 if depends: 661 if depends:
653 depends_dict = bb.utils.explode_dep_versions(depends) 662 depends_dict = bb.utils.explode_dep_versions2(depends)
654 for dep in depends_dict: 663 for dep in depends_dict:
655 ver = depends_dict[dep] 664 for ver in depends_dict[dep]:
656 if dep and ver:
657 ver = ver.replace('(', '') 665 ver = ver.replace('(', '')
658 ver = ver.replace(')', '') 666 ver = ver.replace(')', '')
659 array.append("%s: %s %s" % (tag, dep, ver)) 667 array.append("%s: %s %s" % (tag, dep, ver))
660 else: 668 if not len(depends_dict[dep]):
661 array.append("%s: %s" % (tag, dep)) 669 array.append("%s: %s" % (tag, dep))
662 670
663 def walk_files(walkpath, target, conffiles): 671 def walk_files(walkpath, target, conffiles):
@@ -709,7 +717,7 @@ python write_specfile () {
709 srchomepage = d.getVar('HOMEPAGE', True) 717 srchomepage = d.getVar('HOMEPAGE', True)
710 srcdescription = d.getVar('DESCRIPTION', True) or "." 718 srcdescription = d.getVar('DESCRIPTION', True) or "."
711 719
712 srcdepends = strip_multilib(d.getVar('DEPENDS', True), d) 720 srcdepends = strip_multilib_deps(d.getVar('DEPENDS', True), d)
713 srcrdepends = [] 721 srcrdepends = []
714 srcrrecommends = [] 722 srcrrecommends = []
715 srcrsuggests = [] 723 srcrsuggests = []
@@ -772,12 +780,12 @@ python write_specfile () {
772 # Map the dependencies into their final form 780 # Map the dependencies into their final form
773 mapping_rename_hook(localdata) 781 mapping_rename_hook(localdata)
774 782
775 splitrdepends = strip_multilib(localdata.getVar('RDEPENDS', True), d) or "" 783 splitrdepends = strip_multilib_deps(localdata.getVar('RDEPENDS', True), d)
776 splitrrecommends = strip_multilib(localdata.getVar('RRECOMMENDS', True), d) or "" 784 splitrrecommends = strip_multilib_deps(localdata.getVar('RRECOMMENDS', True), d)
777 splitrsuggests = strip_multilib(localdata.getVar('RSUGGESTS', True), d) or "" 785 splitrsuggests = strip_multilib_deps(localdata.getVar('RSUGGESTS', True), d)
778 splitrprovides = strip_multilib(localdata.getVar('RPROVIDES', True), d) or "" 786 splitrprovides = strip_multilib_deps(localdata.getVar('RPROVIDES', True), d)
779 splitrreplaces = strip_multilib(localdata.getVar('RREPLACES', True), d) or "" 787 splitrreplaces = strip_multilib_deps(localdata.getVar('RREPLACES', True), d)
780 splitrconflicts = strip_multilib(localdata.getVar('RCONFLICTS', True), d) or "" 788 splitrconflicts = strip_multilib_deps(localdata.getVar('RCONFLICTS', True), d)
781 splitrobsoletes = [] 789 splitrobsoletes = []
782 790
783 # Gather special src/first package data 791 # Gather special src/first package data
@@ -826,16 +834,16 @@ python write_specfile () {
826 spec_preamble_bottom.append('Group: %s' % splitsection) 834 spec_preamble_bottom.append('Group: %s' % splitsection)
827 835
828 # Replaces == Obsoletes && Provides 836 # Replaces == Obsoletes && Provides
829 if splitrreplaces and splitrreplaces.strip() != "": 837 robsoletes = bb.utils.explode_dep_versions2(splitrobsoletes or "")
830 for dep in splitrreplaces.split(','): 838 rprovides = bb.utils.explode_dep_versions2(splitrprovides or "")
831 if splitrprovides: 839 rreplaces = bb.utils.explode_dep_versions2(splitrreplaces or "")
832 splitrprovides = splitrprovides + ", " + dep 840 for dep in rreplaces:
833 else: 841 if not dep in robsoletes:
834 splitrprovides = dep 842 robsoletes[dep] = rreplaces[dep]
835 if splitrobsoletes: 843 if not dep in rprovides:
836 splitrobsoletes = splitrobsoletes + ", " + dep 844 rprovides[dep] = rreplaces[dep]
837 else: 845 splitrobsoletes = bb.utils.join_deps(robsoletes, commasep=False)
838 splitrobsoletes = dep 846 splitrprovides = bb.utils.join_deps(rprovides, commasep=False)
839 847
840 print_deps(splitrdepends, "Requires", spec_preamble_bottom, d) 848 print_deps(splitrdepends, "Requires", spec_preamble_bottom, d)
841 # Suggests in RPM are like recommends in OE-core! 849 # Suggests in RPM are like recommends in OE-core!
@@ -847,7 +855,7 @@ python write_specfile () {
847 855
848 # conflicts can not be in a provide! We will need to filter it. 856 # conflicts can not be in a provide! We will need to filter it.
849 if splitrconflicts: 857 if splitrconflicts:
850 depends_dict = bb.utils.explode_dep_versions(splitrconflicts) 858 depends_dict = bb.utils.explode_dep_versions2(splitrconflicts)
851 newdeps_dict = {} 859 newdeps_dict = {}
852 for dep in depends_dict: 860 for dep in depends_dict:
853 if dep not in splitrprovides: 861 if dep not in splitrprovides:
@@ -918,16 +926,16 @@ python write_specfile () {
918 tail_source(d) 926 tail_source(d)
919 927
920 # Replaces == Obsoletes && Provides 928 # Replaces == Obsoletes && Provides
921 if srcrreplaces and srcrreplaces.strip() != "": 929 robsoletes = bb.utils.explode_dep_versions2(srcrobsoletes or "")
922 for dep in srcrreplaces.split(','): 930 rprovides = bb.utils.explode_dep_versions2(srcrprovides or "")
923 if srcrprovides: 931 rreplaces = bb.utils.explode_dep_versions2(srcrreplaces or "")
924 srcrprovides = srcrprovides + ", " + dep 932 for dep in rreplaces:
925 else: 933 if not dep in robsoletes:
926 srcrprovides = dep 934 robsoletes[dep] = rreplaces[dep]
927 if srcrobsoletes: 935 if not dep in rprovides:
928 srcrobsoletes = srcrobsoletes + ", " + dep 936 rprovides[dep] = rreplaces[dep]
929 else: 937 srcrobsoletes = bb.utils.join_deps(robsoletes, commasep=False)
930 srcrobsoletes = dep 938 srcrprovides = bb.utils.join_deps(rprovides, commasep=False)
931 939
932 print_deps(srcdepends, "BuildRequires", spec_preamble_top, d) 940 print_deps(srcdepends, "BuildRequires", spec_preamble_top, d)
933 print_deps(srcrdepends, "Requires", spec_preamble_top, d) 941 print_deps(srcrdepends, "Requires", spec_preamble_top, d)
@@ -940,7 +948,7 @@ python write_specfile () {
940 948
941 # conflicts can not be in a provide! We will need to filter it. 949 # conflicts can not be in a provide! We will need to filter it.
942 if srcrconflicts: 950 if srcrconflicts:
943 depends_dict = bb.utils.explode_dep_versions(srcrconflicts) 951 depends_dict = bb.utils.explode_dep_versions2(srcrconflicts)
944 newdeps_dict = {} 952 newdeps_dict = {}
945 for dep in depends_dict: 953 for dep in depends_dict:
946 if dep not in srcrprovides: 954 if dep not in srcrprovides: