diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-03-09 13:19:22 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-03-09 13:19:22 +0000 |
commit | c21c3b0befeb46a51b6bf3758ffa30813bea0ff0 (patch) | |
tree | 9754ff1ca740f6346cf8483ec915d4054bc5da2d /fluent-bit/lib/librdkafka-2.1.0/packaging/tools/gh-release-checksums.py | |
parent | Adding upstream version 1.43.2. (diff) | |
download | netdata-c21c3b0befeb46a51b6bf3758ffa30813bea0ff0.tar.xz netdata-c21c3b0befeb46a51b6bf3758ffa30813bea0ff0.zip |
Adding upstream version 1.44.3.upstream/1.44.3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'fluent-bit/lib/librdkafka-2.1.0/packaging/tools/gh-release-checksums.py')
-rwxr-xr-x | fluent-bit/lib/librdkafka-2.1.0/packaging/tools/gh-release-checksums.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/fluent-bit/lib/librdkafka-2.1.0/packaging/tools/gh-release-checksums.py b/fluent-bit/lib/librdkafka-2.1.0/packaging/tools/gh-release-checksums.py new file mode 100755 index 000000000..e7259dc20 --- /dev/null +++ b/fluent-bit/lib/librdkafka-2.1.0/packaging/tools/gh-release-checksums.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python3 +# +# Calculate checksums for GitHub release artifacts/assets. +# +# Use the direct links rather than getting the tarball URLs from +# the GitHub API since the latter uses the git-sha1 rather than the tag +# in its zipped up content, causing checksum mismatches. +# + +import sys +import requests +import hashlib + + +if __name__ == '__main__': + + if len(sys.argv) != 2: + print("Usage: {} <tag>".format(sys.argv[0])) + sys.exit(1) + + tag = sys.argv[1] + + print("## Checksums") + print("Release asset checksums:") + + for ftype in ["zip", "tar.gz"]: + url = "https://github.com/edenhill/librdkafka/archive/{}.{}".format( + tag, ftype) + + h = hashlib.sha256() + + r = requests.get(url, stream=True) + while True: + buf = r.raw.read(100 * 1000) + if len(buf) == 0: + break + h.update(buf) + + print(" * {}.{} SHA256 `{}`".format(tag, ftype, h.hexdigest())) |