We refer to port multiple times, make it convenient

This commit is contained in:
Jeff Epler 2022-10-14 11:28:29 -05:00
parent 641a398a54
commit d08b43f704
No known key found for this signature in database
GPG Key ID: D5BF15AB975AB4DE

View File

@ -131,9 +131,9 @@ def set_boards_to_build(build_all):
# See if it is port specific # See if it is port specific
port_matches = port_pattern.search(p) port_matches = port_pattern.search(p)
port = port_matches.group(1) if port_matches else None
module_matches = module_pattern.search(p) module_matches = module_pattern.search(p)
if port_matches and not module_matches: if port and not module_matches:
port = port_matches.group(1)
if port != "unix": if port != "unix":
boards_to_build.update(port_to_boards[port]) boards_to_build.update(port_to_boards[port])
continue continue
@ -149,8 +149,7 @@ def set_boards_to_build(build_all):
# As a (nearly) last resort, for some certain files, we compute the settings from the # As a (nearly) last resort, for some certain files, we compute the settings from the
# makefile for each board and determine whether to build them that way. # makefile for each board and determine whether to build them that way.
if p.startswith("frozen") or p.startswith("supervisor") or module_matches: if p.startswith("frozen") or p.startswith("supervisor") or module_matches:
if port_matches: if port:
port = port_matches.group(1)
board_ids = port_to_boards[port] board_ids = port_to_boards[port]
else: else:
board_ids = all_board_ids board_ids = all_board_ids