From 9211fd9c375489c73924fd43f1f8a0da2c4290bb Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Sun, 10 Apr 2011 10:50:16 -0700 Subject: bitbake/ast.py: Only run finalise() for the specified variant Allows the heavy finalise function to only be run for the case we're interested in when running tasks, saving some processing time. Signed-off-by: Richard Purdie --- bitbake/lib/bb/cache.py | 1 + bitbake/lib/bb/parse/ast.py | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'bitbake') diff --git a/bitbake/lib/bb/cache.py b/bitbake/lib/bb/cache.py index cdde363..955b400 100644 --- a/bitbake/lib/bb/cache.py +++ b/bitbake/lib/bb/cache.py @@ -294,6 +294,7 @@ class Cache(object): logger.debug(1, "Parsing %s (full)", fn) + cfgData.setVar("__ONLYFINALISE", virtual or "default") bb_data = cls.load_bbfile(fn, appends, cfgData) return bb_data[virtual] diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py index b968db4..375dc61 100644 --- a/bitbake/lib/bb/parse/ast.py +++ b/bitbake/lib/bb/parse/ast.py @@ -369,10 +369,13 @@ def multi_finalize(fn, d): logger.debug(2, "Appending .bbappend file %s to %s", append, fn) bb.parse.BBHandler.handle(append, d, True) + onlyfinalise = d.getVar("__ONLYFINALISE", False) + safe_d = d d = bb.data.createCopy(safe_d) try: - finalize(fn, d) + if not onlyfinalise or "default" in onlyfinalise: + finalize(fn, d) except bb.parse.SkipPackage: bb.data.setVar("__SKIPPED", True, d) datastores = {"": safe_d} @@ -434,7 +437,8 @@ def multi_finalize(fn, d): for variant, variant_d in datastores.iteritems(): if variant: try: - finalize(fn, variant_d, variant) + if not onlyfinalise or variant in onlyfinalise: + finalize(fn, variant_d, variant) except bb.parse.SkipPackage: bb.data.setVar("__SKIPPED", True, variant_d) -- cgit v1.1