spec-tests/ holds test/core's scripts at a named commit, under their Apache-2.0 licence, unpacked by a script that checks the digest first. spectest now fails on what it only used to print, and the step runs it and the differential on them. R12's reason said the rule kept a checker small. It doesn't: R2 comes first, so a checker holds a full validator anyway. The rule stands, for what a sink's engine runs. The custom-section row now says the identifier is the section's contents. Co-Authored-By: Claude Opus 5.5 <[email protected]>
11 lines
515 B
Python
11 lines
515 B
Python
#!/usr/bin/env python3
|
|
"""Check core.tar.xz against its digest and unpack it into a directory: extract.py DIR."""
|
|
import hashlib, pathlib, sys, tarfile
|
|
|
|
SHA256 = "78bb8ad1bc9523ca3b76b0c86baa374140dd508eeae4fa7f34c180c2480a683f"
|
|
archive = pathlib.Path(__file__).with_name("core.tar.xz")
|
|
digest = hashlib.sha256(archive.read_bytes()).hexdigest()
|
|
if digest != SHA256:
|
|
sys.exit(f"extract.py: core.tar.xz is {digest}, not {SHA256}")
|
|
with tarfile.open(archive) as tar:
|
|
tar.extractall(sys.argv[1], filter="data")
|