Browse Source

modules: fail on invalid ZEPHYR_EXTRA_MODULES

Add error checking in zephyr_module.py so that if the user manually
specifies ZEPHYR_EXTRA_MODULES and the list contains something that
isn't in fact a valid module, we scream and die.

This should help with diagnosing module errors.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
pull/22385/head
Martí Bolívar 6 years ago committed by Carles Cufí
parent
commit
34346c41ac
  1. 10
      scripts/zephyr_module.py

10
scripts/zephyr_module.py

@ -174,7 +174,7 @@ def main(): @@ -174,7 +174,7 @@ def main():
parser.add_argument('-m', '--modules', nargs='+',
help="""List of modules to parse instead of using `west
list`""")
parser.add_argument('-x', '--extra-modules', nargs='+',
parser.add_argument('-x', '--extra-modules', nargs='+', default=[],
help='List of extra modules to parse')
parser.add_argument('-w', '--west-path', default='west',
help='Path to west executable')
@ -201,9 +201,8 @@ def main(): @@ -201,9 +201,8 @@ def main():
else:
projects = args.modules
if args.extra_modules is not None:
projects += args.extra_modules
projects += args.extra_modules
extra_modules = set(args.extra_modules)
kconfig = ""
cmake = ""
@ -219,6 +218,9 @@ def main(): @@ -219,6 +218,9 @@ def main():
kconfig += process_kconfig(project, meta)
cmake += process_cmake(project, meta)
sanitycheck += process_sanitycheck(project, meta)
elif project in extra_modules:
sys.exit(f'{project}, given in ZEPHYR_EXTRA_MODULES, '
'is not a valid zephyr module')
if args.kconfig_out:
with open(args.kconfig_out, 'w', encoding="utf-8") as fp:

Loading…
Cancel
Save