summaryrefslogtreecommitdiff
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:08 +0000
commit563828bad19a242bba9ce3db461bb5807037dfdf (patch)
treef070e047f30de99d93364f04c1fd9c254ba5273c /meta/classes/multilib.bbclass
parent0f485bfd6fc82a109b9da629e464fca1e90faec3 (diff)
downloadopenembedded-core-563828bad19a242bba9ce3db461bb5807037dfdf.tar.gz
openembedded-core-563828bad19a242bba9ce3db461bb5807037dfdf.tar.bz2
openembedded-core-563828bad19a242bba9ce3db461bb5807037dfdf.zip
multilib: Abstract class extension code into classextend.py
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}-"
python __anonymous () {
variant = d.getVar("BBEXTENDVARIANT", True)
- def map_dependencies(varname, d, suffix = ""):
- if suffix:
- varname = varname + "_" + suffix
- deps = d.getVar(varname, True)
- if not deps:
- return
- deps = bb.utils.explode_deps(deps)
- newdeps = []
- for dep in deps:
- if dep.endswith(("-native", "-native-runtime")):
- newdeps.append(dep)
- else:
- newdeps.append(multilib_extend_name(variant, dep))
- d.setVar(varname, " ".join(newdeps))
+ import oe.classextend
+
+ clsextend = oe.classextend.ClassExtender(variant, d)
if bb.data.inherits_class('image', d):
- map_dependencies("PACKAGE_INSTALL", d)
- map_dependencies("LINGUAS_INSTALL", d)
- map_dependencies("RDEPENDS", d)
+ clsextend.map_depends_variable("PACKAGE_INSTALL")
+ clsextend.map_depends_variable("LINGUAS_INSTALL")
+ clsextend.map_depends_variable("RDEPENDS")
pinstall = d.getVar("LINGUAS_INSTALL", True) + " " + d.getVar("PACKAGE_INSTALL", True)
d.setVar("PACKAGE_INSTALL", pinstall)
d.setVar("LINGUAS_INSTALL", "")
@@ -63,32 +52,13 @@ python __anonymous () {
d.setVar("PACKAGE_INSTALL_ATTEMPTONLY", "")
return
- pkgs_mapping = []
- for pkg in (d.getVar("PACKAGES", True) or "").split():
- if pkg.startswith(variant):
- pkgs_mapping.append([pkg.split(variant + "-")[1], pkg])
- continue
- pkgs_mapping.append([pkg, multilib_extend_name(variant, pkg)])
-
- d.setVar("PACKAGES", " ".join([row[1] for row in pkgs_mapping]))
-
- vars = (d.getVar("PACKAGEVARS", True) or "").split()
- for pkg_mapping in pkgs_mapping:
- for subs in vars:
- d.renameVar("%s_%s" % (subs, pkg_mapping[0]), "%s_%s" % (subs, pkg_mapping[1]))
-
- map_dependencies("DEPENDS", d)
- for pkg in (d.getVar("PACKAGES", True).split() + [""]):
- map_dependencies("RDEPENDS", d, pkg)
- map_dependencies("RRECOMMENDS", d, pkg)
- map_dependencies("RSUGGESTS", d, pkg)
- map_dependencies("RPROVIDES", d, pkg)
- map_dependencies("RREPLACES", d, pkg)
- map_dependencies("RCONFLICTS", d, pkg)
- map_dependencies("PKG", d, pkg)
+ clsextend.rename_packages()
+ clsextend.rename_package_variables((d.getVar("PACKAGEVARS", True) or "").split())
- multilib_map_variable("PROVIDES", variant, d)
- multilib_map_variable("PACKAGES_DYNAMIC", variant, d)
- multilib_map_variable("PACKAGE_INSTALL", variant, d)
- multilib_map_variable("INITSCRIPT_PACKAGES", variant, d)
+ clsextend.map_depends_variable("DEPENDS")
+ clsextend.map_packagevars()
+ clsextend.map_variable("PROVIDES")
+ clsextend.map_variable("PACKAGES_DYNAMIC")
+ clsextend.map_variable("PACKAGE_INSTALL")
+ clsextend.map_variable("INITSCRIPT_PACKAGES")
}