]> err.no Git - dak/commitdiff
daklib/upload.py: handle missing Files (Checksums-*) fields like empty ones
authorAnsgar Burchardt <ansgar@debian.org>
Mon, 27 May 2013 22:12:33 +0000 (00:12 +0200)
committerAnsgar Burchardt <ansgar@debian.org>
Mon, 27 May 2013 22:13:45 +0000 (00:13 +0200)
The upload will still be rejected later, but process-upload will be
happier.

daklib/upload.py

index 1683b8b0f4b152fe38c9641441d8ed1cef6ca4ef..d6a527afcd32c7efa541546cc505c00041304282 100644 (file)
@@ -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()