diff options
Diffstat (limited to 'bitbake/lib/bb/cache.py')
-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, |