]> code.ossystems Code Review - openembedded-core.git/commitdiff
Don't try to expand non-string values
authorChris Larson <chris_larson@mentor.com>
Tue, 20 Apr 2010 18:53:31 +0000 (11:53 -0700)
committerRichard Purdie <rpurdie@linux.intel.com>
Fri, 2 Jul 2010 14:41:34 +0000 (15:41 +0100)
(Bitbake rev: fe36a726b9f930bbd6fd758c0aee78559e95f02b)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
bitbake/lib/bb/build.py
bitbake/lib/bb/cache.py
bitbake/lib/bb/cooker.py
bitbake/lib/bb/parse/parse_py/BBHandler.py

index 4f14e63ac7e25283c7872bd2d262d69c4ce535b8..1b1775f9dbb50c2e6e245ad45d1e35ca0e85fe01 100644 (file)
@@ -99,18 +99,19 @@ def exec_func(func, d, dirs = None):
 
     ispython = flags['python']
 
-    cleandirs = (data.expand(flags['cleandirs'], d) or "").split()
-    for cdir in cleandirs:
-        os.system("rm -rf %s" % cdir)
+    cleandirs = flags['cleandirs']
+    if cleandirs:
+        for cdir in data.expand(cleandirs, d).split():
+            os.system("rm -rf %s" % cdir)
 
-    if dirs:
-        dirs = data.expand(dirs, d)
-    else:
-        dirs = (data.expand(flags['dirs'], d) or "").split()
-    for adir in dirs:
-        bb.utils.mkdirhier(adir)
+    if dirs is None:
+        dirs = flags['dirs']
+        if dirs:
+            dirs = data.expand(dirs, d).split()
 
-    if len(dirs) > 0:
+    if dirs:
+        for adir in dirs:
+            bb.utils.mkdirhier(adir)
         adir = dirs[-1]
     else:
         adir = data.getVar('B', d, 1)
@@ -157,9 +158,10 @@ def exec_func(func, d, dirs = None):
     os.dup2(se.fileno(), ose[1])
 
     locks = []
-    lockfiles = (data.expand(flags['lockfiles'], d) or "").split()
-    for lock in lockfiles:
-        locks.append(bb.utils.lockfile(lock))
+    lockfiles = flags['lockfiles']
+    if lockfiles:
+        for lock in data.expand(lockfiles, d).split():
+            locks.append(bb.utils.lockfile(lock))
 
     try:
         # Run the function
index 6e124b2e83c1008454072f64e2dd0a5365b78d86..1d592a42f1f3491331288686458cd4f6b6d982d2 100644 (file)
@@ -72,7 +72,7 @@ class Cache:
         # If any of configuration.data's dependencies are newer than the
         # cache there isn't even any point in loading it...
         newest_mtime = 0
-        deps = bb.data.getVar("__depends", data, True)
+        deps = bb.data.getVar("__depends", data)
         for f, old_mtime in deps:
             if old_mtime > newest_mtime:
                 newest_mtime = old_mtime
@@ -136,7 +136,7 @@ class Cache:
         # Make sure __depends makes the depends_cache
         # If we're a virtual class we need to make sure all our depends are appended
         # to the depends of fn.
-        depends = self.getVar("__depends", virtualfn, True) or []
+        depends = self.getVar("__depends", virtualfn) or []
         self.depends_cache.setdefault(fn, {})
         if "__depends" not in self.depends_cache[fn] or not self.depends_cache[fn]["__depends"]:
             self.depends_cache[fn]["__depends"] = depends
@@ -218,7 +218,7 @@ class Cache:
         for data in bb_data:
             virtualfn = self.realfn2virtual(fn, data)
             self.setData(virtualfn, fn, bb_data[data])
-            if self.getVar("__SKIPPED", virtualfn, True):
+            if self.getVar("__SKIPPED", virtualfn):
                 skipped += 1
                 bb.msg.debug(1, bb.msg.domain.Cache, "Skipping %s" % virtualfn)
             else:
@@ -361,7 +361,7 @@ class Cache:
         packages_dynamic = (self.getVar('PACKAGES_DYNAMIC', file_name, True) or "").split()
         rprovides = (self.getVar("RPROVIDES", file_name, True) or "").split()
 
-        cacheData.task_deps[file_name] = self.getVar("_task_deps", file_name, True)
+        cacheData.task_deps[file_name] = self.getVar("_task_deps", file_name)
 
         # build PackageName to FileName lookup table
         if pn not in cacheData.pkg_pn:
index 613654db855dbe91bd55a2ef351ec66974680712..96fdb66270e7efe7a0e59eedd961bfcf4c7c9136 100644 (file)
@@ -567,7 +567,7 @@ class BBCooker:
 
             # Nomally we only register event handlers at the end of parsing .bb files
             # We register any handlers we've found so far here...
-            for var in data.getVar('__BBHANDLERS', self.configuration.data) or []:
+            for var in bb.data.getVar('__BBHANDLERS', self.configuration.data) or []:
                 bb.event.register(var, bb.data.getVar(var, self.configuration.data))
 
             bb.fetch.fetcher_init(self.configuration.data)
index a388773bb78f5c040a498de4f4db5749529006a2..52fd8285edcf0e3d09da49f3a5e496a8258ec8fd 100644 (file)
@@ -68,8 +68,8 @@ def inherit(files, d):
     __inherit_cache = data.getVar('__inherit_cache', d) or []
     fn = ""
     lineno = 0
-    files = data.expand(files, d)
     for file in files:
+        file = data.expand(file, d)
         if file[0] != "/" and file[-8:] != ".bbclass":
             file = os.path.join('classes', '%s.bbclass' % file)