Browse Source

waf: fixed case insensitive board name

master
Andrew Tridgell 6 years ago
parent
commit
9e50c1b64e
  1. 6
      Tools/ardupilotwaf/boards.py
  2. 7
      wscript

6
Tools/ardupilotwaf/boards.py

@ -295,12 +295,6 @@ Please use a replacement build as follows: @@ -295,12 +295,6 @@ Please use a replacement build as follows:
''' % ctx.env.BOARD)
boards = _board_classes.keys()
if not ctx.env.BOARD in boards:
# try case-insensitive match
for b in boards:
if b.upper() == ctx.env.BOARD.upper():
ctx.env.BOARD = b
break
if not ctx.env.BOARD in boards:
ctx.fatal("Invalid board '%s': choices are %s" % (ctx.env.BOARD, ', '.join(boards)))
_board = _board_classes[ctx.env.BOARD]()

7
wscript

@ -325,6 +325,13 @@ def configure(cfg): @@ -325,6 +325,13 @@ def configure(cfg):
if cfg.options.board is None:
cfg.options.board = 'sitl'
boards_names = boards.get_boards_names()
if not cfg.options.board in boards_names:
for b in boards_names:
if b.upper() == cfg.options.board.upper():
cfg.options.board = b
break
cfg.env.BOARD = cfg.options.board
cfg.env.DEBUG = cfg.options.debug
cfg.env.AUTOCONFIG = cfg.options.autoconfig

Loading…
Cancel
Save