Skip to content

Commit 5939794

Browse files
author
MarcoFalke
committed
Merge bitcoin/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 #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/bitcoin@9b5feb7 Tree-SHA512: 791fa693477eebbda7fd41f3f5ec78fe7eab57df06979aa907ab258a6945534bdc3b931ddfce0fb440c9666b98c88ce5e1b6dc353ed39e129e87d3634855165c
2 parents 00c3236 + 9b5feb7 commit 5939794

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

test/get_previous_releases.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def download_binary(tag, args) -> int:
136136
tarballHash = hasher.hexdigest()
137137

138138
if tarballHash not in SHA256_SUMS or SHA256_SUMS[tarballHash]['tarball'] != tarball:
139-
if tarball in SHA256_SUMS.values():
139+
if tarball in [v['tarball'] for v in SHA256_SUMS.values()]:
140140
print("Checksum did not match")
141141
return 1
142142

@@ -260,11 +260,10 @@ def main(args) -> int:
260260
help='download release binary.')
261261
parser.add_argument('-t', '--target-dir', action='store',
262262
help='target directory.', default='releases')
263-
parser.add_argument('tags', nargs='*', default=set(
264-
[v['tag'] for v in SHA256_SUMS.values()]
265-
),
263+
all_tags = sorted([*set([v['tag'] for v in SHA256_SUMS.values()])])
264+
parser.add_argument('tags', nargs='*', default=all_tags,
266265
help='release tags. e.g.: v0.18.1 v0.20.0rc2 '
267-
'(if not specified, the full list needed for'
266+
'(if not specified, the full list needed for '
268267
'backwards compatibility tests will be used)'
269268
)
270269
args = parser.parse_args()

0 commit comments

Comments
 (0)