From: German Service Network Date: Sat, 19 Aug 2023 14:38:58 +0000 (+0200) Subject: Merge github 8bb6676 (use streaming sha256 when linking to sourcepool) X-Git-Url: https://git.gsnw.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;p=raspbmirror.git Merge github 8bb6676 (use streaming sha256 when linking to sourcepool) --- 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