summaryrefslogtreecommitdiffstats
path: root/meta/classes/multilib.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-12-21 13:52:46 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-01-05 12:36:29 +0000
commit8e43f9a751f1637d483d48aa9a9a647d1e3d2003 (patch)
tree77eb98fbd61bf59f66c02089c74661353254d01a /meta/classes/multilib.bbclass
parent0fa52f70789afe5a53384ba20249af34c16a8568 (diff)
downloadpoky-8e43f9a751f1637d483d48aa9a9a647d1e3d2003.tar.gz
multilib: Abstract class extension code into classextend.py
(From OE-Core rev: 563828bad19a242bba9ce3db461bb5807037dfdf) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/multilib.bbclass')
-rw-r--r--meta/classes/multilib.bbclass58
1 files changed, 14 insertions, 44 deletions
diff --git a/meta/classes/multilib.bbclass b/meta/classes/multilib.bbclass
index 6eb3bc3756..87d0cd4f5e 100644
--- a/meta/classes/multilib.bbclass
+++ b/meta/classes/multilib.bbclass
@@ -37,25 +37,14 @@ STAGINGCC_prepend = "${BBEXTENDVARIANT}-"
37python __anonymous () { 37python __anonymous () {
38 variant = d.getVar("BBEXTENDVARIANT", True) 38 variant = d.getVar("BBEXTENDVARIANT", True)
39 39
40 def map_dependencies(varname, d, suffix = ""): 40 import oe.classextend
41 if suffix: 41
42 varname = varname + "_" + suffix 42 clsextend = oe.classextend.ClassExtender(variant, d)
43 deps = d.getVar(varname, True)
44 if not deps:
45 return
46 deps = bb.utils.explode_deps(deps)
47 newdeps = []
48 for dep in deps:
49 if dep.endswith(("-native", "-native-runtime")):
50 newdeps.append(dep)
51 else:
52 newdeps.append(multilib_extend_name(variant, dep))
53 d.setVar(varname, " ".join(newdeps))
54 43
55 if bb.data.inherits_class('image', d): 44 if bb.data.inherits_class('image', d):
56 map_dependencies("PACKAGE_INSTALL", d) 45 clsextend.map_depends_variable("PACKAGE_INSTALL")
57 map_dependencies("LINGUAS_INSTALL", d) 46 clsextend.map_depends_variable("LINGUAS_INSTALL")
58 map_dependencies("RDEPENDS", d) 47 clsextend.map_depends_variable("RDEPENDS")
59 pinstall = d.getVar("LINGUAS_INSTALL", True) + " " + d.getVar("PACKAGE_INSTALL", True) 48 pinstall = d.getVar("LINGUAS_INSTALL", True) + " " + d.getVar("PACKAGE_INSTALL", True)
60 d.setVar("PACKAGE_INSTALL", pinstall) 49 d.setVar("PACKAGE_INSTALL", pinstall)
61 d.setVar("LINGUAS_INSTALL", "") 50 d.setVar("LINGUAS_INSTALL", "")
@@ -63,32 +52,13 @@ python __anonymous () {
63 d.setVar("PACKAGE_INSTALL_ATTEMPTONLY", "") 52 d.setVar("PACKAGE_INSTALL_ATTEMPTONLY", "")
64 return 53 return
65 54
66 pkgs_mapping = [] 55 clsextend.rename_packages()
67 for pkg in (d.getVar("PACKAGES", True) or "").split(): 56 clsextend.rename_package_variables((d.getVar("PACKAGEVARS", True) or "").split())
68 if pkg.startswith(variant):
69 pkgs_mapping.append([pkg.split(variant + "-")[1], pkg])
70 continue
71 pkgs_mapping.append([pkg, multilib_extend_name(variant, pkg)])
72
73 d.setVar("PACKAGES", " ".join([row[1] for row in pkgs_mapping]))
74
75 vars = (d.getVar("PACKAGEVARS", True) or "").split()
76 for pkg_mapping in pkgs_mapping:
77 for subs in vars:
78 d.renameVar("%s_%s" % (subs, pkg_mapping[0]), "%s_%s" % (subs, pkg_mapping[1]))
79
80 map_dependencies("DEPENDS", d)
81 for pkg in (d.getVar("PACKAGES", True).split() + [""]):
82 map_dependencies("RDEPENDS", d, pkg)
83 map_dependencies("RRECOMMENDS", d, pkg)
84 map_dependencies("RSUGGESTS", d, pkg)
85 map_dependencies("RPROVIDES", d, pkg)
86 map_dependencies("RREPLACES", d, pkg)
87 map_dependencies("RCONFLICTS", d, pkg)
88 map_dependencies("PKG", d, pkg)
89 57
90 multilib_map_variable("PROVIDES", variant, d) 58 clsextend.map_depends_variable("DEPENDS")
91 multilib_map_variable("PACKAGES_DYNAMIC", variant, d) 59 clsextend.map_packagevars()
92 multilib_map_variable("PACKAGE_INSTALL", variant, d) 60 clsextend.map_variable("PROVIDES")
93 multilib_map_variable("INITSCRIPT_PACKAGES", variant, d) 61 clsextend.map_variable("PACKAGES_DYNAMIC")
62 clsextend.map_variable("PACKAGE_INSTALL")
63 clsextend.map_variable("INITSCRIPT_PACKAGES")
94} 64}