From ff3747e97a779673df12ff1b6d59e59b485ecd41 Mon Sep 17 00:00:00 2001 From: German Service Network Date: Sat, 19 Aug 2023 16:38:58 +0200 Subject: [PATCH] Merge github 8bb6676 (use streaming sha256 when linking to sourcepool) --- raspbmirror.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/raspbmirror.py b/raspbmirror.py index b6db72a..2a8f8ff 100644 --- a/raspbmirror.py +++ b/raspbmirror.py @@ -254,11 +254,7 @@ def getfile(path,sha256,size): if os.path.isfile(spp) and (size == os.path.getsize(spp)): logging.info('trying file from sourcepool '+spp.decode('ascii')) ts = os.path.getmtime(spp) - f = open(spp,'rb') - data = f.read() - f.close() - sha256hash = hashlib.sha256(data) - sha256hashed = sha256hash.hexdigest().encode('ascii') + [ sha256hashed, size ] = getfilesha256andsize(spp); if (sha256 != sha256hashed): logging.info('hash mismatch while trying file from sourcepool, ignoring file'); data = None -- 2.25.1