[oe-commits] Chris Larson : base: start leveraging oe.types

git version control git at git.openembedded.org
Fri Apr 22 17:52:27 UTC 2011


Module: openembedded.git
Branch: shr/testing2011.1
Commit: a87337170a93fdb6c636c84e3cf1b2108964f863
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=a87337170a93fdb6c636c84e3cf1b2108964f863

Author: Chris Larson <chris_larson at mentor.com>
Date:   Tue Nov  9 18:42:10 2010 -0700

base: start leveraging oe.types

Signed-off-by: Chris Larson <chris_larson at mentor.com>

---

 classes/base.bbclass |   28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/classes/base.bbclass b/classes/base.bbclass
index ac0f388..fc9b2ae 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]
 
@@ -94,8 +96,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)
 }
@@ -110,12 +112,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)
@@ -144,7 +145,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)
@@ -202,13 +203,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
@@ -243,7 +244,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)
@@ -305,8 +306,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





More information about the Openembedded-commits mailing list