summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2011-01-07 08:38:41 -0700
committerChris Larson <chris_larson@mentor.com>2011-01-07 08:43:05 -0700
commit96ee6840010c1ae1080e6bf7ff0f4eb2d361e84b (patch)
treecea561cffe1e02e7677897d6d03a9585f786fa48 /lib
parent6de4f9f5857ecce5bbd4d490ecbbd3570e5b3ee5 (diff)
downloadbitbake-96ee6840010c1ae1080e6bf7ff0f4eb2d361e84b.tar.gz
cache: don't expand variables for skipped recipes
Errors can result from these expansions, but for skipped recipes, we shouldn't care about those failures. This fixes the same issue which Richard Purdie fixed in poky, commit 847b717. Signed-off-by: Chris Larson <chris_larson@mentor.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/bb/cache.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/bb/cache.py b/lib/bb/cache.py
index e1800bb5e..e960d1e8a 100644
--- a/lib/bb/cache.py
+++ b/lib/bb/cache.py
@@ -98,7 +98,19 @@ class RecipeInfo(namedtuple('RecipeInfo', recipe_fields)):
return metadata.getVar(var, True) or ''
@classmethod
+ def make_optional(cls, default=None, **kwargs):
+ """Construct the namedtuple from the specified keyword arguments,
+ with every value considered optional, using the default value if
+ it was not specified."""
+ for field in cls._fields:
+ kwargs[field] = kwargs.get(field, default)
+ return cls(**kwargs)
+
+ @classmethod
def from_metadata(cls, filename, metadata):
+ if cls.getvar('__SKIPPED', metadata):
+ return cls.make_optional(skipped=True)
+
pn = cls.getvar('PN', metadata)
packages = cls.listvar('PACKAGES', metadata)
if not pn in packages:
@@ -108,7 +120,7 @@ class RecipeInfo(namedtuple('RecipeInfo', recipe_fields)):
task_deps = metadata.getVar('_task_deps', False) or
{'tasks': [], 'parents': {}},
variants = cls.listvar('__VARIANTS', metadata) + [''],
- skipped = cls.getvar('__SKIPPED', metadata),
+ skipped = False,
timestamp = bb.parse.cached_mtime(filename),
packages = cls.listvar('PACKAGES', metadata),
pn = pn,