X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Fupload.py;h=1683b8b0f4b152fe38c9641441d8ed1cef6ca4ef;hb=52eb03dccab0a9898bca4d36a0a96ebe377fb977;hp=a6f1e4b819072c228e4c1a17b89cad944a7a81ea;hpb=1aaa31abc190aba714ee84c97927696274f8b2c0;p=dak.git diff --git a/daklib/upload.py b/daklib/upload.py index a6f1e4b8..1683b8b0 100644 --- a/daklib/upload.py +++ b/daklib/upload.py @@ -191,7 +191,9 @@ 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 None: + raise InvalidChangesException('{0} is listed in Checksums-Sha1, but not in Files.'.format(filename)) + 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 @@ -201,8 +203,8 @@ def parse_file_list(control, has_priority_and_section): (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): + raise InvalidChangesException('{0} is listed in Checksums-Sha256, but not in Files.'.format(filename)) + 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