Skip to content

Commit 9b5feb7

Browse files
committed
script: small fixups/improvements for get_previous_releases.py
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"
1 parent 9c47eb4 commit 9b5feb7

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)