File size: 539 Bytes
6c3fe2a
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
#!/usr/bin/env python3
import hashlib
from pathlib import Path
r=Path(__file__).resolve().parent;m=r/"BUNDLE_SHA256SUMS.txt";seen=set()
for row in m.read_text(encoding="utf-8").splitlines():
 digest,rel=row.split("  ",1);p=r/rel;assert p.is_file() and hashlib.sha256(p.read_bytes()).hexdigest()==digest,rel;seen.add(rel)
actual={p.relative_to(r).as_posix() for p in r.rglob("*") if p.is_file() and p!=m and "__pycache__" not in p.parts and p.suffix!=".pyc"}
assert seen==actual,(seen^actual);print(f"manifest verified: {len(seen)} files")