From 1eb31f4f548bbefc4c0187d959806f34c90e282e Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Tue, 24 Jan 2023 01:09:18 +0000 Subject: [PATCH] upload-release: Update SHA256SUM for existing files if changed. In the very infrequent case that we re-upload a file, the logic for upload-release would have the existing SHA256SUM take precedence over the new one -- despite uploading the new file. Skip existing filenames (i.e. from the new file) when gathering SHA256SUM metadata used to assemble `SHA256SUMS.txt`. --- tools/upload-release | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/upload-release b/tools/upload-release index 8c4f91c870..5673e15f09 100755 --- a/tools/upload-release +++ b/tools/upload-release @@ -51,6 +51,9 @@ for obj_summary in bucket.objects.filter(Prefix="server/zulip-server-"): head = client.head_object(Bucket=bucket.name, Key=obj_summary.key) assert obj_summary.key.startswith("server/") filename = obj_summary.key[len("server/") :] + if filename in file_hashes: + print(f" {filename} was already uploaded, skipping existing hash") + continue metadata = head["Metadata"] if "sha256sum" not in metadata: print(f" {filename} does not have SHA256 metadata!")