diff options
author | Chris Larson <chris_larson@mentor.com> | 2011-01-07 08:38:41 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-01-10 13:24:03 +0000 |
commit | f305e95840a887bbd97e9003e7a0f9135df77fcb (patch) | |
tree | 4097812a83b4b34d7e056260ca16a1c6457988f7 /bitbake | |
parent | b22e345e05efcc3f66278af8f09fb083afe32b68 (diff) | |
download | poky-f305e95840a887bbd97e9003e7a0f9135df77fcb.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.
(Bitbake rev: 96ee6840010c1ae1080e6bf7ff0f4eb2d361e84b)
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/cache.py | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/bitbake/lib/bb/cache.py b/bitbake/lib/bb/cache.py index cde136083a..9a2e2d5298 100644 --- a/bitbake/lib/bb/cache.py +++ b/bitbake/lib/bb/cache.py | |||
@@ -106,7 +106,19 @@ class RecipeInfo(namedtuple('RecipeInfo', recipe_fields)): | |||
106 | return metadata.getVar(var, True) or '' | 106 | return metadata.getVar(var, True) or '' |
107 | 107 | ||
108 | @classmethod | 108 | @classmethod |
109 | def make_optional(cls, default=None, **kwargs): | ||
110 | """Construct the namedtuple from the specified keyword arguments, | ||
111 | with every value considered optional, using the default value if | ||
112 | it was not specified.""" | ||
113 | for field in cls._fields: | ||
114 | kwargs[field] = kwargs.get(field, default) | ||
115 | return cls(**kwargs) | ||
116 | |||
117 | @classmethod | ||
109 | def from_metadata(cls, filename, metadata): | 118 | def from_metadata(cls, filename, metadata): |
119 | if cls.getvar('__SKIPPED', metadata): | ||
120 | return cls.make_optional(skipped=True) | ||
121 | |||
110 | tasks = metadata.getVar('__BBTASKS', False) | 122 | tasks = metadata.getVar('__BBTASKS', False) |
111 | 123 | ||
112 | pn = cls.getvar('PN', metadata) | 124 | pn = cls.getvar('PN', metadata) |
@@ -114,15 +126,6 @@ class RecipeInfo(namedtuple('RecipeInfo', recipe_fields)): | |||
114 | if not pn in packages: | 126 | if not pn in packages: |
115 | packages.append(pn) | 127 | packages.append(pn) |
116 | 128 | ||
117 | skip = cls.getvar('__SKIPPED', metadata) | ||
118 | if skip: | ||
119 | return RecipeInfo(None, None, None, None, None, | ||
120 | None, None, None, None, None, | ||
121 | None, skip, None, None, None, | ||
122 | None, None, None, None, None, | ||
123 | None, None, None, None, None, | ||
124 | None, None) | ||
125 | |||
126 | return RecipeInfo( | 129 | return RecipeInfo( |
127 | tasks = tasks, | 130 | tasks = tasks, |
128 | basetaskhashes = cls.taskvar('BB_BASEHASH', tasks, metadata), | 131 | basetaskhashes = cls.taskvar('BB_BASEHASH', tasks, metadata), |
@@ -133,7 +136,7 @@ class RecipeInfo(namedtuple('RecipeInfo', recipe_fields)): | |||
133 | {'tasks': [], 'parents': {}}, | 136 | {'tasks': [], 'parents': {}}, |
134 | variants = cls.listvar('__VARIANTS', metadata) + [''], | 137 | variants = cls.listvar('__VARIANTS', metadata) + [''], |
135 | 138 | ||
136 | skipped = skip, | 139 | skipped = False, |
137 | timestamp = bb.parse.cached_mtime(filename), | 140 | timestamp = bb.parse.cached_mtime(filename), |
138 | packages = cls.listvar('PACKAGES', metadata), | 141 | packages = cls.listvar('PACKAGES', metadata), |
139 | pn = pn, | 142 | pn = pn, |