From 9e50c1b64e114448d871f9b82bc6395074df9d9b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 7 Mar 2019 07:58:56 +1100 Subject: [PATCH] waf: fixed case insensitive board name --- Tools/ardupilotwaf/boards.py | 6 ------ wscript | 7 +++++++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Tools/ardupilotwaf/boards.py b/Tools/ardupilotwaf/boards.py index d35c1a7d98..960719bb4f 100644 --- a/Tools/ardupilotwaf/boards.py +++ b/Tools/ardupilotwaf/boards.py @@ -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]() diff --git a/wscript b/wscript index 86599fadf5..523ff79796 100644 --- a/wscript +++ b/wscript @@ -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