mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-11 12:33:53 -06:00
fix: compare whole md5 in the folder check
check_platform_folder.py, the script the site publishes, still accepted a cut md5 by prefix. It now compares whole digests as Batocera does (batocera-systems:1088), like verify since cut_md5_owner.
This commit is contained in:
1 parent
7d99685ce1
commit
35be4cf033
4 files changed
+12
-9
No files matched your search
@@ -27,8 +27,8 @@ def accepts(entry: dict, path: Path, mode: str) -> bool:
|
||||
member = names.get(entry["zipped_file"].casefold())
|
||||
return bool(member) and hashlib.new(digest, archive.read(member)).hexdigest() in values
|
||||
actual = hashlib.new(digest, path.read_bytes()).hexdigest()
|
||||
if entry.get("zip_digest") != "composite" and any(actual.startswith(v) for v in values):
|
||||
return True # a truncated md5 (Batocera) compares by its prefix
|
||||
if entry.get("zip_digest") != "composite" and actual in values:
|
||||
return True # whole digests, as batocera-systems:1088 compares them
|
||||
if digest == DIGESTS["md5"] and path.suffix.lower() == ".zip": # Recalbox: members in name order
|
||||
with zipfile.ZipFile(path) as archive:
|
||||
names = sorted(name for name in archive.namelist() if not name.endswith("/"))
|
||||
|
||||
Reference in new issue
Block a user