From 3209197b0bb0fb6154eac341ae399cc136cdf386 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 7 May 2019 17:20:13 +0800 Subject: [PATCH] artiq_flash: do not needlessly look for artifacts --- artiq/frontend/artiq_flash.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/artiq/frontend/artiq_flash.py b/artiq/frontend/artiq_flash.py index db4d26f39..4cfbf1f91 100755 --- a/artiq/frontend/artiq_flash.py +++ b/artiq/frontend/artiq_flash.py @@ -293,8 +293,10 @@ def main(): if bin_dir is None: bin_dir = os.path.join(artiq_dir, "board-support") + needs_artifacts = any(action in args.action + for action in ["gateware", "bootloader", "firmware", "load"]) variant = args.variant - if variant is None: + if needs_artifacts and variant is None: variants = [] if args.srcbuild: for entry in os.scandir(bin_dir): @@ -317,10 +319,11 @@ def main(): else: raise ValueError("more than one variant found for selected board, specify -V. " "Found variants: {}".format(" ".join(sorted(variants)))) - if args.srcbuild: - variant_dir = variant - else: - variant_dir = args.target + "-" + variant + if needs_artifacts: + if args.srcbuild: + variant_dir = variant + else: + variant_dir = args.target + "-" + variant if args.host is None: client = LocalClient()