diff options
author | Chris Larson <chris_larson@mentor.com> | 2010-11-09 18:42:10 -0700 |
---|---|---|
committer | Chris Larson <chris_larson@mentor.com> | 2010-12-28 09:19:51 -0700 |
commit | d0206a116e96d9ab74cc637caa2543da22d16ac1 (patch) | |
tree | 713159c4c5bdf8e2892386c0f8bc5c8aaa94ac34 | |
parent | 81c07de405f3987af72316993948dfa7e7b13dbb (diff) | |
download | openembedded-d0206a116e96d9ab74cc637caa2543da22d16ac1.tar.gz |
base: start leveraging oe.types
Signed-off-by: Chris Larson <chris_larson@mentor.com>
-rw-r--r-- | classes/base.bbclass | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/classes/base.bbclass b/classes/base.bbclass index f1c0228bd1..c76b77ddef 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -10,11 +10,13 @@ inherit utils inherit utility-tasks inherit metadata_scm -OE_IMPORTS += "oe.path oe.utils oe.packagegroup sys os time" +OE_IMPORTS += "oe.path oe.utils oe.packagegroup oe.types sys os time" +OE_IMPORTS[type] = "list" python oe_import () { if isinstance(e, bb.event.ConfigParsed): import os, sys + bbpath = e.data.getVar("BBPATH", True).split(":") sys.path[0:0] = [os.path.join(dir, "lib") for dir in bbpath] @@ -95,8 +97,8 @@ python base_scenefunction () { } python base_do_setscene () { - for f in (bb.data.getVar('SCENEFUNCS', d, 1) or '').split(): - bb.build.exec_func(f, d) + for func in oe.types.value('SCENEFUNCS', d): + bb.build.exec_func(func, d) if not os.path.exists(bb.data.getVar('STAMP', d, 1) + ".do_setscene"): bb.build.make_stamp("do_setscene", d) } @@ -111,12 +113,11 @@ python base_do_fetch() { localdata = bb.data.createCopy(d) bb.data.update_data(localdata) - src_uri = bb.data.getVar('SRC_URI', localdata, 1) + src_uri = oe.types.value('SRC_URI', localdata) if not src_uri: return 1 - try: - bb.fetch.init(src_uri.split(),d) + bb.fetch.init(src_uri, d) except bb.fetch.NoMethodError: (type, value, traceback) = sys.exc_info() raise bb.build.FuncFailed("No method: %s" % value) @@ -145,7 +146,7 @@ python base_do_fetch() { # Check each URI first_uri = True - for url in src_uri.split(): + for url in src_uri: localpath = bb.data.expand(bb.fetch.localpath(url, localdata), localdata) (type,host,path,_,_,params) = bb.decodeurl(url) uri = "%s://%s%s" % (type,host,path) @@ -203,13 +204,13 @@ do_unpack[dirs] = "${WORKDIR}" python base_do_unpack() { from glob import glob - src_uri = d.getVar("SRC_URI", True) + src_uri = oe.types.value("SRC_URI", d) if not src_uri: return - srcurldata = bb.fetch.init(src_uri.split(), d, True) - filespath = d.getVar("FILESPATH", True).split(":") + srcurldata = bb.fetch.init(src_uri, d, True) + filespath = oe.types.value("FILESPATH", d) - for url in src_uri.split(): + for url in src_uri: urldata = srcurldata[url] if urldata.type == "file" and "*" in urldata.path: # The fetch code doesn't know how to handle globs, so @@ -267,7 +268,7 @@ python build_summary() { statusmsg = "\n%s\n%s\n" % (bb.data.getVar("BUILDCFG_HEADER", e.data, 1), "\n".join(statuslines)) bb.plain(statusmsg) - needed_vars = bb.data.getVar("BUILDCFG_NEEDEDVARS", e.data, 1).split() + needed_vars = oe.types.value("BUILDCFG_NEEDEDVARS", e.data) pesteruser = [] for v in needed_vars: val = bb.data.getVar(v, e.data, 1) @@ -332,8 +333,7 @@ def set_multimach_arch(d): multiarch = pkg_arch - packages = bb.data.getVar('PACKAGES', d, 1).split() - for pkg in packages: + for pkg in oe.types.value('PACKAGES', d): pkgarch = bb.data.getVar("PACKAGE_ARCH_%s" % pkg, d, 1) # We could look for != PACKAGE_ARCH here but how to choose |