bitbake: cooker: list all nonexistent bblayer directories
PATCH 1/1 bitbake: cooker: list all nonexistent bblayer directories
Check existence of all the bblayer direcotories at once and print them all, so if there are multiple nonexistent directories, user does not have to correct bblayers.conf and restart bitbake multiple times.
[YOCTO #11647]
--- bitbake/lib/bb/cookerdata.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)
bitbake/lib/bb/cookerdata.py +13 -3
@@ -342,14 +342,24 @@ class CookerDataBuilder(object): data = parse_config_file(layerconf, data) layers = (data.getVar('BBLAYERS') or "").split() + broken_layers = [] data = bb.data.createCopy(data) approved = bb.utils.approved_variables() + + # Check whether present layer directories exist for layer in layers: if not os.path.isdir(layer): - parselog.critical("Layer directory '%s' does not exist! " - "Please check BBLAYERS in %s" % (layer, layerconf)) - sys.exit(1) + broken_layers.append(layer) + + if broken_layers: + parselog.critical("The following layer directories do not exist:") + for layer in broken_layers: + parselog.critical(" %s", layer) + parselog.critical("Please check BBLAYERS in %s" % (layerconf)) + sys.exit(1) + + for layer in layers: parselog.debug(2, "Adding layer %s", layer) if 'HOME' in approved and '~' in layer: layer = os.path.expanduser(layer)
Signature · 1 line
2.17.1
This is how log will look like:
ERROR: Unable to start bitbake server (None)
ERROR: Server log for this session (/home/sashko/projects/yocto/open-embedded/build/bitbake-cookerdaemon.log):
--- Starting bitbake server pid 11745 at 2019-06-14 02:08:15.687299 ---
ERROR: The following layer directories do not exist:
ERROR: /home/sashko/projects/yocto/open-embedded/sources/poky/meta-abc ERROR: /home/sashko/projects/yocto/open-embedded/sources/poky/meta-xyz
ERROR: Please check BBLAYERS in /home/sashko/projects/yocto/open-embedded/build/conf/bblayers.conf
Quoted 43 lines · Oleksandr Kravchuk
Check existence of all the bblayer direcotories at once and print them all, so if there are multiple nonexistent directories, user does not have to correct bblayers.conf and restart bitbake multiple times.
[YOCTO #11647]
Signed-off-by Oleksandr Kravchuk <[email protected]>--- bitbake/lib/bb/cookerdata.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)bitbake/lib/bb/cookerdata.py +13
-3@@ -342,14 +342,24 @@ class CookerDataBuilder(object): data = parse_config_file(layerconf, data) layers = (data.getVar('BBLAYERS') or "").split() + broken_layers = [] data = bb.data.createCopy(data) approved = bb.utils.approved_variables() + + # Check whether present layer directories exist for layer in layers: if not os.path.isdir(layer): - parselog.critical("Layer directory '%s' does not exist! " - "Please check BBLAYERS in %s" % (layer, layerconf)) - sys.exit(1) + broken_layers.append(layer) + + if broken_layers: + parselog.critical("The following layer directories do not exist:") + for layer in broken_layers: + parselog.critical(" %s", layer) + parselog.critical("Please check BBLAYERS in %s" % (layerconf)) + sys.exit(1) + + for layer in layers: parselog.debug(2, "Adding layer %s", layer) if 'HOME' in approved and '~' in layer: layer = os.path.expanduser(layer)
Quoted 15 lines · Oleksandr Kravchuk
This is how log will look like:
ERROR: Unable to start bitbake server (None)
ERROR: Server log for this session (/home/sashko/projects/yocto/open-embedded/build/bitbake-cookerdaemon.log):
--- Starting bitbake server pid 11745 at 2019-06-14 02:08:15.687299
---
ERROR: The following layer directories do not exist:
ERROR:/home/sashko/projects/yocto/open-
embedded/sources/poky/meta-abc
ERROR:/home/sashko/projects/yocto/open-
embedded/sources/poky/meta-xyz
ERROR: Please check BBLAYERS in/home/sashko/projects/yocto/open-embedded/build/conf/bblayers.conf
Looks good to me, I've merged this thanks!
Cheers,
Richard