Skip to content

Commit 78cbdd2

Browse files
committed
Add checksum check for libs
1 parent 40b0351 commit 78cbdd2

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

tools/get.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -151,16 +151,9 @@ def is_latest_version(destination, dirname, rename_to, cfile, checksum):
151151
expected_version = None
152152

153153
try:
154-
if rename_to.startswith("esp32-arduino-libs"):
155-
# Remove this when moving to new release system
156-
expected_version = cfile.read(dirname + "/versions.txt").decode("utf-8")
157-
with open(os.path.join(destination, rename_to, "versions.txt"), "r") as f:
158-
# cfile is zip
159-
current_version = f.read()
160-
else:
161-
expected_version = checksum
162-
with open(os.path.join(destination, rename_to, ".package_checksum"), "r") as f:
163-
current_version = f.read()
154+
expected_version = checksum
155+
with open(os.path.join(destination, rename_to, ".package_checksum"), "r") as f:
156+
current_version = f.read()
164157

165158
if verbose:
166159
print(f"\nTool: {rename_to}")
@@ -361,7 +354,7 @@ def get_tool(tool, force_download, force_extract):
361354
print("Tool {0} already downloaded".format(archive_name))
362355
sys.stdout.flush()
363356

364-
if "esp32-arduino-libs" not in archive_name and sha256sum(local_path) != checksum:
357+
if sha256sum(local_path) != checksum:
365358
print("Checksum mismatch for {0}".format(archive_name))
366359
return False
367360

0 commit comments

Comments
 (0)