]> git.decadent.org.uk Git - dak.git/blobdiff - daklib/upload.py
parse_file_list: handle files without an entry in the Files field
[dak.git] / daklib / upload.py
index a6f1e4b819072c228e4c1a17b89cad944a7a81ea..059cc51189299f5bbad2f3732e340fd7ad29552b 100644 (file)
@@ -191,7 +191,7 @@ def parse_file_list(control, has_priority_and_section):
             continue
         (sha1sum, size, filename) = line.split()
         entry = entries.get(filename, None)
-        if entry.get('size', None) != long(size):
+        if entry is not None and entry.get('size', None) != long(size):
             raise InvalidChangesException('Size for {0} in Files and Checksum-Sha1 fields differ.'.format(filename))
         entry['sha1sum'] = sha1sum
 
@@ -200,9 +200,7 @@ def parse_file_list(control, has_priority_and_section):
             continue
         (sha256sum, size, filename) = line.split()
         entry = entries.get(filename, None)
-        if entry is None:
-            raise InvalidChangesException('No sha256sum for {0}.'.format(filename))
-        if entry.get('size', None) != long(size):
+        if entry is not None and entry.get('size', None) != long(size):
             raise InvalidChangesException('Size for {0} in Files and Checksum-Sha256 fields differ.'.format(filename))
         entry['sha256sum'] = sha256sum