Skip to content

Commit 10ef076

Browse files
committed
Fix dev/releases/utils_github.py
1 parent fbb2634 commit 10ef076

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

dev/releases/utils_github.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import subprocess
1212

1313
import github
14-
from utils import error, notice, sha256file, verify_via_checksumfile
14+
from utils import error, notice, sha256file
1515

1616
CURRENT_REPO_NAME = os.environ.get("GITHUB_REPOSITORY", "gap-system/gap")
1717

@@ -59,6 +59,16 @@ def initialize_github(token=None) -> None:
5959
error("Error: the access token may be incorrect")
6060

6161

62+
def verify_via_checksumfile(filename: str) -> None:
63+
actual_checksum = sha256file(filename)
64+
with open(filename + ".sha256", "r", encoding="utf-8") as f:
65+
expected_checksum = f.read().strip()
66+
if expected_checksum != actual_checksum:
67+
error(
68+
f"checksum for '{filename}' expected to be {expected_checksum} but got {actual_checksum}"
69+
)
70+
71+
6272
# Given the <filename> of a file that does not end with .sha256, create or get
6373
# the corresponding sha256 checksum file <filename>.sha256, (comparing checksums
6474
# just to be safe, in the latter case). Then upload the files <filename> and

0 commit comments

Comments
 (0)