From 31748563ebd30fc8be95294d3960aa0df352b582 Mon Sep 17 00:00:00 2001 From: Ansgar Burchardt Date: Tue, 28 May 2013 00:12:33 +0200 Subject: [PATCH] daklib/upload.py: handle missing Files (Checksums-*) fields like empty ones The upload will still be rejected later, but process-upload will be happier. --- daklib/upload.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/daklib/upload.py b/daklib/upload.py index 1683b8b0..d6a527af 100644 --- a/daklib/upload.py +++ b/daklib/upload.py @@ -173,7 +173,7 @@ def parse_file_list(control, has_priority_and_section): """ entries = {} - for line in control["Files"].split('\n'): + for line in control.get("Files", "").split('\n'): if len(line) == 0: continue @@ -186,7 +186,7 @@ def parse_file_list(control, has_priority_and_section): entries[filename] = entry - for line in control["Checksums-Sha1"].split('\n'): + for line in control.get("Checksums-Sha1", "").split('\n'): if len(line) == 0: continue (sha1sum, size, filename) = line.split() @@ -197,7 +197,7 @@ def parse_file_list(control, has_priority_and_section): raise InvalidChangesException('Size for {0} in Files and Checksum-Sha1 fields differ.'.format(filename)) entry['sha1sum'] = sha1sum - for line in control["Checksums-Sha256"].split('\n'): + for line in control.get("Checksums-Sha256", "").split('\n'): if len(line) == 0: continue (sha256sum, size, filename) = line.split() -- 2.39.5