Skip to content

Commit

Permalink
script: small fixups/improvements for get_previous_releases.py
Browse files Browse the repository at this point in the history
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"
  • Loading branch information
theStack committed Nov 28, 2022
1 parent 9c47eb4 commit 9b5feb7
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions test/get_previous_releases.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def download_binary(tag, args) -> int:
tarballHash = hasher.hexdigest()

if tarballHash not in SHA256_SUMS or SHA256_SUMS[tarballHash]['tarball'] != tarball:
if tarball in SHA256_SUMS.values():
if tarball in [v['tarball'] for v in SHA256_SUMS.values()]:
print("Checksum did not match")
return 1

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

0 comments on commit 9b5feb7

Please sign in to comment.