Skip to content

Commit adee584

Browse files
MarcoFalkeknst
authored andcommitted
Merge bitcoin#26589: test: small fixups/improvements for get_previous_releases.py
9b5feb7 script: small fixups/improvements for get_previous_releases.py (Sebastian Falbesoner) Pull request description: This is a small follow-up to bitcoin#25650 (commit 614d468) with three fixes/improvements: - fix "Checksum did not match" detection, which was not adapted to the new `SHA256_SUMS` structure and hence never executed (the list of tarball names isn't directly in the dictionary's values anymore, but has to be extracted from the `'tarball'` field of each value) - make both help text and default tag download order deterministic by sorting default tags - `--tags` argument help text: add missing space between "for" and "backwards" ACKs for top commit: Sjors: tACK 9b5feb7. Tested that if I change a checksum, or remove a release, it catches that. josibake: tested ACK bitcoin@9b5feb7 Tree-SHA512: 791fa693477eebbda7fd41f3f5ec78fe7eab57df06979aa907ab258a6945534bdc3b931ddfce0fb440c9666b98c88ce5e1b6dc353ed39e129e87d3634855165c
1 parent cc8e992 commit adee584

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

test/get_previous_releases.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def download_binary(tag, args) -> int:
168168
tarballHash = hasher.hexdigest()
169169

170170
if tarballHash not in SHA256_SUMS or SHA256_SUMS[tarballHash]['tarball'] != tarball:
171-
if tarball in SHA256_SUMS.values():
171+
if tarball in [v['tarball'] for v in SHA256_SUMS.values()]:
172172
print("Checksum did not match")
173173
return 1
174174

@@ -320,9 +320,8 @@ def main(args) -> int:
320320
help='download release binary.')
321321
parser.add_argument('-t', '--target-dir', action='store',
322322
help='target directory.', default='releases')
323-
parser.add_argument('tags', nargs='*', default=set(
324-
[v['tag'] for v in SHA256_SUMS.values()]
325-
),
323+
all_tags = sorted([*set([v['tag'] for v in SHA256_SUMS.values()])])
324+
parser.add_argument('tags', nargs='*', default=all_tags,
326325
help='release tags. e.g.: v19.1.0 v19.0.0-rc.9'
327326
'(if not specified, the full list needed for'
328327
'backwards compatibility tests will be used)'

0 commit comments

Comments
 (0)