File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 1111import subprocess
1212
1313import github
14- from utils import error , notice , sha256file , verify_via_checksumfile
14+ from utils import error , notice , sha256file
1515
1616CURRENT_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
You can’t perform that action at this time.
0 commit comments