summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2017-06-07 11:03:18 +0200
committerBogdan Oprescu <bogdan.oprescu@enea.com>2023-10-20 15:58:38 +0200
commit6c76baf37cecb4b81d61ff23123712a8d291d365 (patch)
tree488f2648c5b1d256879390cad92d0f6d300ab8d7
parent0ca0a5e14b2897cc8df7539b4b576594363d519a (diff)
downloadpoky-pyro-enea.tar.gz
bitbake: cookerdata: Add support for BBFILES_DYNAMICpyro-enea
BBFILES_DYNAMIC can be used to activate content only when some other layers are present. The other layers are identified by the collections that they define. The main use case is to avoid .bbappends without the corresponding .bb file in layers that want to modify other layers via .bbappends without introducing a hard dependency on those other layers. .bb files could also be handled via BBFILES_DYNAMIC. Entries in BBFILES_DYNAMIC must have the form <collection name>:<filename pattern>. Example usage: BBFILES_DYNAMIC += " \ clang-layer:${LAYERDIR}/bbappends/meta-clang/*/*/*.bbappend \ core:${LAYERDIR}/bbappends/openembedded-core/meta/*/*/*.bbappend \ " Parsing is aborted when invalid entries are found with an error message like this: ERROR: BBFILES_DYNAMIC entries must be of the form <collection name>:<filename pattern>, not: /work/my-layer/bbappends/meta-security-isafw/*/*/*.bbappend /work/my-layer/bbappends/openembedded-core/meta/*/*/*.bbappend Based on a patch by Richard Purdie. (Bitbake rev: 04f8bd50aa04b12cf91dd6a3154527ad2c24695c) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/cookerdata.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/bitbake/lib/bb/cookerdata.py b/bitbake/lib/bb/cookerdata.py
index e408a35e15..d421091aa7 100644
--- a/bitbake/lib/bb/cookerdata.py
+++ b/bitbake/lib/bb/cookerdata.py
@@ -346,6 +346,20 @@ class CookerDataBuilder(object):
346 data.delVar('LAYERDIR_RE') 346 data.delVar('LAYERDIR_RE')
347 data.delVar('LAYERDIR') 347 data.delVar('LAYERDIR')
348 348
349 bbfiles_dynamic = (data.getVar('BBFILES_DYNAMIC') or "").split()
350 collections = (data.getVar('BBFILE_COLLECTIONS') or "").split()
351 invalid = []
352 for entry in bbfiles_dynamic:
353 parts = entry.split(":", 1)
354 if len(parts) != 2:
355 invalid.append(entry)
356 continue
357 l, f = parts
358 if l in collections:
359 data.appendVar("BBFILES", " " + f)
360 if invalid:
361 bb.fatal("BBFILES_DYNAMIC entries must be of the form <collection name>:<filename pattern>, not:\n %s" % "\n ".join(invalid))
362
349 if not data.getVar("BBPATH"): 363 if not data.getVar("BBPATH"):
350 msg = "The BBPATH variable is not set" 364 msg = "The BBPATH variable is not set"
351 if not layerconf: 365 if not layerconf: