Overwrite user resources when the originals have changed.

Excepting configs and disks which can be customized.
This commit is contained in:
grossmj committed 2024-11-09 12:17:06 +10:00
1 parent db1fb29c63
commit a60e0d424d
4 files changed
+29 -10

No files matched your search

+12
View File
@@ -23,6 +23,7 @@ import textwrap
import posixpath
import socket
import errno
import hashlib
def force_unix_path(path):
@@ -120,3 +121,14 @@ def is_ipv6_enabled() -> bool:
if e.errno == errno.EADDRINUSE:
return True
raise
def md5sum(filename):
"""
Calculate the MD5 checksum of a file.
"""
hash_md5 = hashlib.md5()
with open(filename, "rb") as f:
for chunk in iter(lambda: f.read(4096), b""):
hash_md5.update(chunk)
return hash_md5.hexdigest()