Commit a144bb49 authored by Ansgar's avatar Ansgar

Merge branch 'pu/changes-binary-field'

parents ff99fab7 6715c86a
......@@ -230,10 +230,15 @@ class ChangesCheck(Check):
control = changes.changes
fn = changes.filename
for field in ('Distribution', 'Source', 'Binary', 'Architecture', 'Version', 'Maintainer', 'Files', 'Changes', 'Description'):
for field in ('Distribution', 'Source', 'Architecture', 'Version', 'Maintainer', 'Files', 'Changes'):
if field not in control:
raise Reject('{0}: misses mandatory field {1}'.format(fn, field))
if len(changes.binaries) > 0:
for field in ('Binary', 'Description'):
if field not in control:
raise Reject('{0}: binary upload requires {1} field'.format(fn, field))
check_fields_for_valid_utf8(fn, control)
source_match = re_field_source.match(control['Source'])
......
......@@ -426,7 +426,7 @@ class Changes(object):
"""names of included binary packages
@type: list of str
"""
return self.changes['Binary'].split()
return self.changes.get('Binary', '').split()
@property
def closed_bugs(self):
......
......@@ -273,8 +273,8 @@ def parse_changes(filename, signing_rules=0, dsc_file=0, keyrings=None):
if not dsc_file:
# Finally ensure that everything needed for .changes is there
must_keywords = ('Format', 'Date', 'Source', 'Binary', 'Architecture', 'Version',
'Distribution', 'Maintainer', 'Description', 'Changes', 'Files')
must_keywords = ('Format', 'Date', 'Source', 'Architecture', 'Version',
'Distribution', 'Maintainer', 'Changes', 'Files')
missingfields = []
for keyword in must_keywords:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment