scripts: zephyr_module: hack to match west 0.7 output

The west command line output is not stable and has changed for 0.7.
Match it in zephyr_module.py's check for whether we are in a
workspace.

The real fix is to start using 'west topdir' whenever the west version
is at least 0.7.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This commit is contained in:
Martí Bolívar 2020-02-11 08:48:08 -08:00 committed by Carles Cufí
parent 17144489d9
commit dc1edb946f

View file

@ -188,10 +188,14 @@ def main():
if p.returncode == 0:
projects = out.decode(sys.getdefaultencoding()).splitlines()
elif re.match((r'Error: .* is not in a west installation\.'
'|FATAL ERROR: no west installation found from .*'),
'|FATAL ERROR: no west installation found from .*'
'|FATAL ERROR: no west workspace.*'),
err.decode(sys.getdefaultencoding())):
# Only accept the error from bootstrapper in the event we are
# outside a west managed project.
# Only accept the error the event we are outside a west
# workspace.
#
# TODO: we can just use "west topdir" instead if we can
# depend on west 0.7.0 or later.
projects = []
else:
print(err.decode(sys.getdefaultencoding()))