Skip to content

Commit 19817fc

Browse files
committed
Fetch TFM configs from origin/development if not present
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
1 parent d261f43 commit 19817fc

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

tools/bin/mtest

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,15 @@ def configure_options(target):
389389
dest = CRYPTO_CONFIG_FILE
390390
else:
391391
dest = CONFIG_FILE
392-
log(f"cp {path[len(ROOT) + 1:] if path.startswith(ROOT) else path} {dest[len(ROOT) + 1:]}")
393-
shutil.copy(path, dest)
392+
if config in { TFM_CONFIG, TFM_CRYPTO_CONFIG } and not os.path.exists(path):
393+
# for looking at old checkouts where these configs were not in the tree, fetch from HEAD instead
394+
log(f"git show origin/development:configs/{config} > {dest[len(ROOT) + 1:]}")
395+
output, _ = subrun(["git", "show", "origin/development:configs/" + config], silent=True)
396+
with open(dest, 'w') as f:
397+
f.write(output)
398+
else:
399+
log(f"cp {path[len(ROOT) + 1:] if path.startswith(ROOT) else path} {dest[len(ROOT) + 1:]}")
400+
shutil.copy(path, dest)
394401
elif config.startswith("MBEDTLS_") or config.startswith("-MBEDTLS_") or config.startswith("PSA_") or config.startswith("-PSA_"):
395402
# an individual option like MBEDTLS_XYZ or -PSA_XYZ
396403
action = "set"

0 commit comments

Comments
 (0)