summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb
diff options
context:
space:
mode:
authorJuro Bystricky <juro.bystricky@intel.com>2017-01-15 11:13:36 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-19 20:20:16 +0000
commit7d18d05d451d4a69d827f7f78e7e17b69f950269 (patch)
tree9ba9b02ae722638a87886be8a20656e4a7ea01b1 /bitbake/lib/bb
parent63f899a950daf1018999455bafa7a2be8b22f164 (diff)
downloadpoky-7d18d05d451d4a69d827f7f78e7e17b69f950269.tar.gz
bitbake: cooker.py: new multiconfig '*' syntax support
Currently you cannot build a target for all the configured multiconfigs without specifying a list. The list can be quite long, requiring to type several lines of text. This enhancement is to support globbing so that you can do this, e.g. instead of: $ bitbake multiconfig:A:bash multiconfig:B:bash bash you can do: $ bitbake multiconfig:*:bash There are real world use cases where it is desirable to use multiconfig with two different tasks. For example: SDKs with multiple toolchains but also containing set of additional host tools, or multiconfig builds requiring one image for the main CPU(s) and a different co-image for a companion CPU. For this reason, two variations of the new syntax are supported. For example, the following: $ bitbake multiconfig:*:meta-toolhchain would expand to: $ bitbake multiconfig:A:meta-toolchain multiconfig:B:meta-toolchain meta-toolchain However the following: $ bitbake multiconfig:*:meta-toolhchain hosttools would expand to: $ bitbake multiconfig:A:meta-toolchain multiconfig:B:meta-toolchain hosttools In other words, if the user specified the "default" task explicitly, it replaces the implicit "default" task. [YOCTO#10680] (Bitbake rev: 1559ad1fc3ae8b1e4e75b210f598b90be192571b) Signed-off-by: Juro Bystricky <juro.bystricky@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r--bitbake/lib/bb/cooker.py32
1 files changed, 31 insertions, 1 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 182d0449e6..5608845611 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -666,7 +666,37 @@ class BBCooker:
666 if not task.startswith("do_"): 666 if not task.startswith("do_"):
667 task = "do_%s" % task 667 task = "do_%s" % task
668 668
669 fulltargetlist = self.checkPackages(pkgs_to_build, task) 669 targetlist = self.checkPackages(pkgs_to_build, task)
670 fulltargetlist = []
671 defaulttask_implicit = ''
672 defaulttask_explicit = False
673 wildcard = False
674
675 # Wild card expansion:
676 # Replace string such as "multiconfig:*:bash"
677 # into "multiconfig:A:bash multiconfig:B:bash bash"
678 for k in targetlist:
679 if k.startswith("multiconfig:"):
680 if wildcard:
681 bb.fatal('multiconfig conflict')
682 if k.split(":")[1] == "*":
683 wildcard = True
684 for mc in self.multiconfigs:
685 if mc:
686 fulltargetlist.append(k.replace('*', mc))
687 # implicit default task
688 else:
689 defaulttask_implicit = k.split(":")[2]
690 else:
691 fulltargetlist.append(k)
692 else:
693 defaulttask_explicit = True
694 fulltargetlist.append(k)
695
696 if not defaulttask_explicit and defaulttask_implicit != '':
697 fulltargetlist.append(defaulttask_implicit)
698
699 bb.debug(1,"Target list: %s" % (str(fulltargetlist)))
670 taskdata = {} 700 taskdata = {}
671 localdata = {} 701 localdata = {}
672 702