Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ gpg --verify apache-burr-${VERSION}-incubating-sdist.tar.gz.asc apache-burr-${VE
gpg --verify apache_burr-${VERSION}-py3-none-any.whl.asc apache_burr-${VERSION}-py3-none-any.whl

# 3. Verify all SHA512 checksums
echo "$(cat apache-burr-${VERSION}-incubating-src.tar.gz.sha512) apache-burr-${VERSION}-incubating-src.tar.gz" | sha512sum -c -
echo "$(cat apache-burr-${VERSION}-incubating-sdist.tar.gz.sha512) apache-burr-${VERSION}-incubating-sdist.tar.gz" | sha512sum -c -
echo "$(cat apache_burr-${VERSION}-py3-none-any.whl.sha512) apache_burr-${VERSION}-py3-none-any.whl" | sha512sum -c -
sha512sum -c apache-burr-${VERSION}-incubating-src.tar.gz.sha512
sha512sum -c apache-burr-${VERSION}-incubating-sdist.tar.gz.sha512
sha512sum -c apache_burr-${VERSION}-py3-none-any.whl.sha512

# 4. Extract the source archive
tar -xzf apache-burr-${VERSION}-incubating-src.tar.gz
Expand Down
10 changes: 8 additions & 2 deletions scripts/apache_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,14 +246,20 @@ def _check_git_working_tree() -> None:


def _checksum_artifact(artifact_path: str) -> str:
"""Create SHA512 checksum for artifact."""
"""Create SHA512 checksum for artifact in the standard ``sha512sum`` layout.

The file is written as ``<digest> <filename>\n`` so that voters can verify
with the standard ``sha512sum -c <file>.sha512`` recipe without having to
splice the filename in by hand.
"""
checksum_path = f"{artifact_path}.sha512"
sha512_hash = hashlib.sha512()
with open(artifact_path, "rb") as f:
while chunk := f.read(65536):
sha512_hash.update(chunk)
artifact_filename = os.path.basename(artifact_path)
with open(checksum_path, "w", encoding="utf-8") as f:
f.write(f"{sha512_hash.hexdigest()}\n")
f.write(f"{sha512_hash.hexdigest()} {artifact_filename}\n")
print(f" ✓ Created SHA512 checksum: {checksum_path}")
return checksum_path

Expand Down
Loading