mirror of
https://github.com/SMGCommunity/Petari.git
synced 2025-02-17 04:28:15 +00:00
setup.py: verify Compilers.zip
This commit is contained in:
parent
46dab62152
commit
b3a8964086
4
setup.py
4
setup.py
@ -6,6 +6,7 @@ import urllib.request
|
||||
import os
|
||||
import sys
|
||||
import subprocess
|
||||
import hashlib
|
||||
|
||||
def install(what):
|
||||
subprocess.check_call([sys.executable, '-m', 'pip', 'install', what])
|
||||
@ -77,6 +78,9 @@ if not os.path.exists("Compilers"):
|
||||
|
||||
with urllib.request.urlopen("http://shibbo.net/smg/Compilers.zip") as response, open("Compilers.zip", 'wb') as out:
|
||||
data = response.read()
|
||||
if hashlib.sha256(data).hexdigest().upper() != "12D439B707D7AECB1BCD5B321DA406310523357128ABADB1493BED212A4A225F":
|
||||
print("Compilers.zip corrupt")
|
||||
sys.exit(1)
|
||||
out.write(data)
|
||||
|
||||
if os.path.exists("Compilers.zip"):
|
||||
|
Loading…
x
Reference in New Issue
Block a user