misc: small fix or general refactoring i did not bother commenting

This commit is contained in:
Simone Margaritelli 2019-10-20 19:50:05 +02:00
parent 6d5054387b
commit 8d0d3df2b0
No known key found for this signature in database
GPG Key ID: 82E42E7F3B34C97E

View File

@ -88,7 +88,8 @@ def install(display, update):
checksums = glob.glob("%s/*.sha256" % path) checksums = glob.glob("%s/*.sha256" % path)
if len(checksums) == 0: if len(checksums) == 0:
if update['native']: if update['native']:
logging.warning("native update without SHA256 checksum file") logging.warning("[update] native update without SHA256 checksum file")
return
else: else:
display.update(force=True, new_data={'status': 'Verifying %s ...' % name}) display.update(force=True, new_data={'status': 'Verifying %s ...' % name})
@ -97,7 +98,7 @@ def install(display, update):
logging.info("[update] verifying %s for %s ..." % (checksum, source_path)) logging.info("[update] verifying %s for %s ..." % (checksum, source_path))
with open(checksums) as fp: with open(checksums, 'rt') as fp:
expected = fp.read().strip().lower() expected = fp.read().strip().lower()
real = subprocess.getoutput('sha256sum "%s"' % source_path).split(' ')[0].strip().lower() real = subprocess.getoutput('sha256sum "%s"' % source_path).split(' ')[0].strip().lower()