Browse Source

Fix issue with amprolla relying on MD5Sum being present.

This patch uses whichever checksum is enabled in the configuration.
wip/archive
Evilham 3 years ago
parent
commit
49d680af73
  1. 6
      lib/lock.py
  2. 11
      lib/parse.py

6
lib/lock.py

@ -41,6 +41,12 @@ def run_without_lock(f, name, *args, **kwargs):
t2 = time()
info('Total {} time: {}'.format(name, (t2 - t1)), tofile=True)
except Exception as e:
try:
import traceback
with open('amprolla.debug.txt', 'a') as f:
traceback.print_exc(file=f)
except:
pass
die(e)

11
lib/parse.py

@ -56,18 +56,17 @@ def parse_release_head(reltext):
"""
Parses the header of the release file to grab needed metadata
"""
import lib.config
checksums = [c['name'] for c in lib.config.checksums]
metadata = {}
contents = reltext.split('\n')
splitter = 'MD5Sum:'
md5sum = False
for line in contents:
if md5sum is True:
if line.split(":")[0] in checksums:
# Checksum_section, stop parsing
break
elif line.startswith(splitter):
md5sum = True
else:
key = line.split(': ')[0]
val = line.split(': ')[1]

Loading…
Cancel
Save