summaryrefslogtreecommitdiffstats
path: root/bitbake
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-03-16 15:34:08 +0000
commitca66b08b3b7254dea23d1a8ac9eedbe2396e7f12 (patch)
treef3fd6f3c66cbcd7540b55f96e8e1045d1d0e460f /bitbake
parentc8daf507295b76c0ea080e043a6e7a26dcdd83e4 (diff)
downloadpoky-ca66b08b3b7254dea23d1a8ac9eedbe2396e7f12.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: 3e80d47bea51b64ed6c8bffc033f2d11a630481e) Signed-off-by: Juro Bystricky <juro.bystricky@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-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 0f48efca6a..4877c4b644 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -668,7 +668,37 @@ class BBCooker:
668 if not task.startswith("do_"): 668 if not task.startswith("do_"):
669 task = "do_%s" % task 669 task = "do_%s" % task
670 670
671 fulltargetlist = self.checkPackages(pkgs_to_build, task) 671 targetlist = self.checkPackages(pkgs_to_build, task)
672 fulltargetlist = []
673 defaulttask_implicit = ''
674 defaulttask_explicit = False
675 wildcard = False
676
677 # Wild card expansion:
678 # Replace string such as "multiconfig:*:bash"
679 # into "multiconfig:A:bash multiconfig:B:bash bash"
680 for k in targetlist:
681 if k.startswith("multiconfig:"):
682 if wildcard:
683 bb.fatal('multiconfig conflict')
684 if k.split(":")[1] == "*":
685 wildcard = True
686 for mc in self.multiconfigs:
687 if mc:
688 fulltargetlist.append(k.replace('*', mc))
689 # implicit default task
690 else:
691 defaulttask_implicit = k.split(":")[2]
692 else:
693 fulltargetlist.append(k)
694 else:
695 defaulttask_explicit = True
696 fulltargetlist.append(k)
697
698 if not defaulttask_explicit and defaulttask_implicit != '':
699 fulltargetlist.append(defaulttask_implicit)
700
701 bb.debug(1,"Target list: %s" % (str(fulltargetlist)))
672 taskdata = {} 702 taskdata = {}
673 localdata = {} 703 localdata = {}
674 704