1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-30 17:21:21 +00:00

tests/upgrade: add support for filenames with revision

This commit is contained in:
Tomas Susanka 2020-08-27 20:24:24 +02:00
parent b780785beb
commit a443a4a430
2 changed files with 5 additions and 2 deletions

View File

@ -54,7 +54,7 @@ def get_tags():
result = defaultdict(list) result = defaultdict(list)
for f in sorted(files): for f in sorted(files):
try: try:
# example: "trezor-emu-core-v2.1.1" # example: "trezor-emu-core-v2.1.1" or "trezor-emu-core-v2.1.1-46ab42fw"
_, _, gen, tag = f.name.split("-", maxsplit=3) _, _, gen, tag = f.name.split("-", maxsplit=3)
result[gen].append(tag) result[gen].append(tag)
except ValueError: except ValueError:

View File

@ -79,7 +79,10 @@ def for_all(*args, legacy_minimum_version=(1, 0, 0), core_minimum_version=(2, 0,
try: try:
for tag in ALL_TAGS[gen]: for tag in ALL_TAGS[gen]:
if tag.startswith("v"): if tag.startswith("v"):
tag_version = tuple(int(n) for n in tag[1:].split(".")) tag_version = tag[1:]
if "-" in tag: # contains revision
tag_version = tag[1:-9]
tag_version = tuple(int(n) for n in tag_version.split("."))
if tag_version < minimum_version: if tag_version < minimum_version:
continue continue
all_params.append((gen, tag)) all_params.append((gen, tag))