From: Chris Larson Date: Fri, 7 Jan 2011 15:38:41 +0000 (-0700) Subject: cache: don't expand variables for skipped recipes X-Git-Tag: 2011-1~2957 X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=f305e95840a887bbd97e9003e7a0f9135df77fcb;p=openembedded-core.git 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 Signed-off-by: Richard Purdie --- 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 @@ -105,8 +105,20 @@ class RecipeInfo(namedtuple('RecipeInfo', recipe_fields)): def getvar(cls, var, metadata): 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) + tasks = metadata.getVar('__BBTASKS', False) pn = cls.getvar('PN', metadata) @@ -114,15 +126,6 @@ class RecipeInfo(namedtuple('RecipeInfo', recipe_fields)): if not pn in packages: packages.append(pn) - skip = cls.getvar('__SKIPPED', metadata) - if skip: - return RecipeInfo(None, None, None, None, None, - None, None, None, None, None, - None, skip, None, None, None, - None, None, None, None, None, - None, None, None, None, None, - None, None) - return RecipeInfo( tasks = tasks, basetaskhashes = cls.taskvar('BB_BASEHASH', tasks, metadata), @@ -133,7 +136,7 @@ class RecipeInfo(namedtuple('RecipeInfo', recipe_fields)): {'tasks': [], 'parents': {}}, variants = cls.listvar('__VARIANTS', metadata) + [''], - skipped = skip, + skipped = False, timestamp = bb.parse.cached_mtime(filename), packages = cls.listvar('PACKAGES', metadata), pn = pn,