diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py index 9841e6874e..d597d1d39b 100644 --- a/bitbake/lib/bb/command.py +++ b/bitbake/lib/bb/command.py @@ -224,11 +224,19 @@ class CommandsAsync: def generateTargetsTree(self, command, params): """ - Generate a tree of all buildable targets. + Generate a tree of buildable targets. + If klass is provided ensure all recipes that inherit the class are + included in the package list. + If pkg_list provided use that list (plus any extras brought in by + klass) rather than generating a tree for all packages. """ klass = params[0] + if len(params) > 1: + pkg_list = params[1] + else: + pkg_list = [] - command.cooker.generateTargetsTree(klass) + command.cooker.generateTargetsTree(klass, pkg_list) command.finishAsyncCommand() generateTargetsTree.needcache = True diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index ebf963d5ba..a6f3befe15 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py @@ -594,12 +594,14 @@ class BBCooker: return target_tree - def generateTargetsTree(self, klass): + def generateTargetsTree(self, klass=None, pkgs=[]): """ Generate a dependency tree of buildable targets Generate an event with the result """ - pkgs = ['world'] + # if the caller hasn't specified a pkgs list default to world + if not len(pkgs): + pkgs = ['world'] # if inherited_class passed ensure all recipes which inherit the # specified class are included in pkgs if klass: