You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@burr.apache.org by po...@apache.org on 2026/05/09 19:59:12 UTC

(burr) branch main updated: Emit standard sha512sum format in release checksums (#769)

This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/burr.git


The following commit(s) were added to refs/heads/main by this push:
     new 30c9b3a8 Emit standard sha512sum format in release checksums (#769)
30c9b3a8 is described below

commit 30c9b3a82398fa461e88270a1825545edd912a76
Author: Jarek Potiuk <ja...@potiuk.com>
AuthorDate: Sat May 9 21:59:08 2026 +0200

    Emit standard sha512sum format in release checksums (#769)
    
    Surfaced during 0.42.0-incubating RC3 verification: the .sha512 files
    shipped on dist.apache.org contain only the bare hex digest, so the
    standard 'sha512sum -c file.sha512' recipe returns 'no properly
    formatted checksum lines found'. Voters either have to work around it
    with 'echo "$(cat ${F}.sha512)  ${F}" | sha512sum -c -' (as the
    README currently does) or compare digests by hand.
    
    Switch _checksum_artifact() to emit the standard '<digest>  <filename>'
    layout that sha512sum -c and shasum -c both expect, and simplify the
    verification recipe in scripts/README.md to plain
    'sha512sum -c <file>.sha512'.
    
    Both checksum readers in the repo (scripts/verify_apache_artifacts.py
    and scripts/apache_release.py::_verify_artifact_checksum) already use
    '.read().strip().split()[0]', so they accept both the old and the new
    format -- verification of existing RCs on dist.apache.org keeps working
    unchanged.
    
    Vote thread:
    https://lists.apache.org/thread/bhcwnjpbx7vhnql48z7vc3njpgrx9qmj
---
 scripts/README.md         |  6 +++---
 scripts/apache_release.py | 10 ++++++++--
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/scripts/README.md b/scripts/README.md
index 3a07b126..9e874cce 100644
--- a/scripts/README.md
+++ b/scripts/README.md
@@ -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
diff --git a/scripts/apache_release.py b/scripts/apache_release.py
index fe6dfb86..678b4cc8 100644
--- a/scripts/apache_release.py
+++ b/scripts/apache_release.py
@@ -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